Class: Keyboard

Guacamole.Keyboard

new 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:
Name Type Description
element Element The Element to use to provide keyboard events.
Source:

Classes

ModifierState

Members

modifiers

All modifiers and their states.
Source:

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.
Source:

Methods

press(keysym) → {Boolean}

Marks a key as pressed, firing the keydown event if registered. Key repeat for the pressed key will start after a delay if that key is not a modifier. The return value of this function depends on the return value of the keydown event handler, if any.
Parameters:
Name Type Description
keysym Number The keysym of the key to press.
Source:
Returns:
true if event should NOT be canceled, false otherwise.
Type
Boolean

release(keysym)

Marks a key as released, firing the keyup event if registered.
Parameters:
Name Type Description
keysym Number The keysym of the key to release.
Source:

reset()

Resets the state of this keyboard, releasing all keys, and firing keyup events for each released key.
Source:

Events

onkeydown

Fired whenever the user presses a key with the element associated with this Guacamole.Keyboard in focus.
Parameters:
Name Type Description
keysym Number The keysym of the key being pressed.
Source:
Returns:
true if the key event should be allowed through to the browser, false otherwise.
Type
Boolean

onkeyup

Fired whenever the user releases a key with the element associated with this Guacamole.Keyboard in focus.
Parameters:
Name Type Description
keysym Number The keysym of the key being released.
Source: