Class Guacamole.Keyboard
Defined in: keyboard.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Guacamole.Keyboard(element)
Provides cross-browser and cross-keyboard keyboard for a specific element.
|
Field Attributes | Field Name and Description |
---|---|
All modifiers and their states.
|
|
The state of every key, indexed by keysym.
|
Method Attributes | Method Name and Description |
---|---|
<inner> |
get_keysym(keysyms, location)
Given an array of keysyms indexed by location, returns the keysym
for the given location, or the keysym for the standard location if
undefined.
|
<inner> |
Given a keyboard event, updates the local modifier state and remote
key state based on the modifier flags within the event.
|
Event Attributes | Event Name and Description |
---|---|
onkeydown(keysym)
Fired whenever the user presses a key with the element associated
with this Guacamole.Keyboard in focus.
|
|
onkeyup(keysym)
Fired whenever the user releases a key with the element associated
with this Guacamole.Keyboard in focus.
|
Class Detail
Guacamole.Keyboard(element)
Provides cross-browser and cross-keyboard keyboard for a specific element.
Browser and keyboard layout variation is abstracted away, providing events
which represent keys as their corresponding X11 keysym.
- Parameters:
- {Element} element
- The Element to use to provide keyboard events.
Field Detail
modifiers
All modifiers and their states.
pressed
The state of every key, indexed by keysym. If a particular key is
pressed, the value of pressed for that keysym will be true. If a key
is not currently pressed, it will not be defined.
Method Detail
<inner>
get_keysym(keysyms, location)
Given an array of keysyms indexed by location, returns the keysym
for the given location, or the keysym for the standard location if
undefined.
- Parameters:
- {Array} keysyms
- An array of keysyms, where the index of the keysym in the array is the location value.
- {Number} location
- The location on the keyboard corresponding to the key pressed, as defined at: http://www.w3.org/TR/DOM-Level-3-Events/#events-KeyboardEvent
<inner>
update_modifier_state(e)
Given a keyboard event, updates the local modifier state and remote
key state based on the modifier flags within the event. This function
pays no attention to keycodes.
- Parameters:
- {KeyboardEvent} e
- The keyboard event containing the flags to update.
Event Detail
onkeydown(keysym)
Fired whenever the user presses a key with the element associated
with this Guacamole.Keyboard in focus.
- Parameters:
- {Number} keysym
- The keysym of the key being pressed.
onkeyup(keysym)
Fired whenever the user releases a key with the element associated
with this Guacamole.Keyboard in focus.
- Parameters:
- {Number} keysym
- The keysym of the key being released.