Implementation:SeleniumHQ Selenium Closure KeyHandler
| Knowledge Sources | |
|---|---|
| Domains | JavaScript_Atoms, Vendored_Library |
| Last Updated | 2026-02-12 00:00 GMT |
Overview
Vendored Google Closure Library module providing a class for working with keyboard events that repeat consistently across browsers and platforms, used by Selenium JavaScript atoms.
Description
goog.events.KeyHandler is a vendored copy of the Google Closure Library module. It provides a wrapper around an element that normalizes keyboard event handling across different browsers and platforms. It unifies key codes so they are consistent regardless of browser, and handles the differences in how browsers fire keydown, keypress, and keyup events, including repeat behavior and character/key code normalization for IE, Firefox, Safari, and Opera. Selenium uses this as part of its JavaScript atom infrastructure for browser automation commands.
Usage
This module is consumed internally by Selenium's JavaScript atoms build system. It is not imported directly by end users.
Code Reference
Source Location
- Repository: SeleniumHQ_Selenium
- File: third_party/closure/goog/events/keyhandler.js
- Lines: 1-538
Key Exports
goog.provide('goog.events.KeyHandler');
goog.provide('goog.events.KeyHandler.EventType');
// Constructor: goog.events.KeyHandler(opt_element, opt_capture)
// Extends: goog.events.EventTarget
// Wraps an element or document to provide normalized keyboard events.