
CHAPTER 4: User-Interface Tools Event handling 152
KeyboardEvent object functions
In addition to the functions defined for UIEvent base class, a keyboard event has these functions.
getModifierState()
eventObj.getModifierState (keyIdentifier)
keyIdentifier
A string containing a modifier key identifier, one of:
Alt
CapsLock
Control
Meta
NumLock
Scroll
Shift
Returns true if the given modifier was active when the event occurred, false otherwise.
initKeyboardEvent()
eventObj.initKeyboardEvent (eventName, bubble, isCancelable, view, keyID,
keyLocation, modifiersList)
eventName
The event name string.
bubble
When true, the event should be triggered in ancestors of the target object
during the bubbling phase.
isCancelable
When true, the event can be cancelled.
view
The container or control object that dispatched the event.
keyID
Sets the keyIdentifier value.
keyLocation
Sets the keyLocation. value.
modifiersList
A whitespace-separated string of modifier key names, such as "Control Alt".
Reinitializes the object, allowing you to change the event properties after construction. Arguments
set the corresponding properties. Returns
undefined.
Comentários a estes Manuais