keycodes.js
No description.

File Location

/goog/events/keycodes.js


Public Protected Private

Enumerations

Global Functions

goog.events.KeyCodes.firesKeyPressEvent(keyCodeopt_heldKeyCodeopt_shiftKeyopt_ctrlKeyopt_altKey) boolean
Returns true if the key fires a keypress event in the current browser. Accoridng to MSDN [1] IE only fires keypress events for the following keys: - Letters: A - Z (uppercase and lowercase) - Numerals: 0 - 9 - Symbols: ! @ # $ % ^ & * ( ) _ - + = < [ ] { } , . / ? \ | ' ` " ~ - System: ESC, SPACEBAR, ENTER That's not entirely correct though, for instance there's no distinction between upper and lower case letters. [1] http://msdn2.microsoft.com/en-us/library/ms536939(VS.85).aspx) Safari is similar to IE, but does not fire keypress for ESC. Additionally, IE6 does not fire keydown or keypress events for letters when the control or alt keys are held down and the shift key is not. IE7 does fire keydown in these cases, though, but not keypress.
Arguments:
keyCode : number
A key code.
opt_heldKeyCode : number=
Key code of a currently-held key.
opt_shiftKey : boolean=
Whether the shift key is held down.
opt_ctrlKey : boolean=
Whether the control key is held down.
opt_altKey : boolean=
Whether the alt key is held down.
Returns: boolean  Whether it's a key that fires a keypress event.
code »
goog.events.KeyCodes.isCharacterKey(keyCode) boolean
Returns true if the key produces a character. This does not cover characters on non-US keyboards (Russian, Hebrew, etc.).
Arguments:
keyCode : number
A key code.
Returns: boolean  Whether it's a character key.
code »
goog.events.KeyCodes.isTextModifyingKeyEvent(e) boolean
Returns true if the event contains a text modifying key.
Arguments:
e : goog.events.BrowserEvent
A key event.
Returns: boolean  Whether it's a text modifying key.
code »
goog.events.KeyCodes.normalizeGeckoKeyCode(keyCode) number
Normalizes key codes from their Gecko-specific value to the general one.
Arguments:
keyCode : number
The native key code.
Returns: number  The normalized key code.
code »
goog.events.KeyCodes.normalizeKeyCode(keyCode) number
Normalizes key codes from OS/Browser-specific value to the general one.
Arguments:
keyCode : number
The native key code.
Returns: number  The normalized key code.
code »
goog.events.KeyCodes.normalizeMacWebKitKeyCode(keyCode) number
Normalizes key codes from their Mac WebKit-specific value to the general one.
Arguments:
keyCode : number
The native key code.
Returns: number  The normalized key code.
code »

Directory events

File Reference