Hotkey Module¶
The Keyboard Module can listen to the same hotkey as the Hotkey module that players bound in their client.
When active, Keyboard Module will forward player's key events to Smart Glasses.
In addition, Keyboard Module may also capture player's mouse by invoking setCaptureMouse(true), and then fire corresponding events.
Events¶
keyboard_open¶
Fires when the player opened the keyboard.
Values: None
1 2 | |
keyboard_close¶
Fires when the player closed the keyboard.
Values: None
1 2 | |
player_mouse_click¶
Fires when a player pressed a mouse button while keyboard module is capturing mouse.
Values:
1. button: number The mouse button which clicked down.
1 2 | |
player_mouse_up¶
Fires when the player released a mouse button while keyboard module is capturing mouse.
Values:
1. button: number The mouse button which released up.
1 2 | |
player_mouse_move¶
Fires when a player moved mouse while keyboard module is capturing mouse.
Values:
1. dx: number Horizontal mouse movement
2. dy: number Vertical mouse movement
1 2 | |
player_mouse_scroll¶
Fires when a player scrolled mouse while keyboard module is capturing mouse.
Values:
1. dy: number Vertical mouse scroll amount
2. dx: number Horizontal mouse scroll amount
1 2 | |
Functions¶
isCapturingKeys¶
isCapturingKeys() -> boolean
returns true if the keyboard is currently open, false otherwise.
isCapturingMouse¶
isCapturingMouse() -> boolean
returns true if the mouse is currently captured, false otherwise.
setCaptureMouse¶
setCaptureMouse(enable: boolean) -> nil
set if the mouse should be captured.
Changelog/Trivia¶
0.8
Added Hotkey Module
