KeyListener
KeyListener class
Constructor Summary
Public Constructor | ||
public |
constructor |
Method Summary
Public Methods | ||
public |
check if any key is pushed |
|
public |
getKeyNewState(keyCode: int): boolean get key new state of given key code |
|
public |
getKeyState(keyCode: int): boolean get key state of given key code |
|
public |
keyDownCallback(event: Event): void callback for keyDown event |
|
public |
keyUpCallback(event: Event): void callback for keyUp event |
|
public |
resetKeyNewState(): void reset key new state |
|
public |
resetKeyState(): void reset key state |
|
public |
setDisable(): void disable key listener |
|
public |
enable/disable key listener |
|
public |
setKeyDownCallback(func: Function): void set keyDown callback function |
|
public |
setKeyUpCallback(func: Function): void set keyUp callback function |
Public Constructors
Public Methods
public getKeyNewState(keyCode: int): boolean source
get key new state of given key code
Params:
Name | Type | Attribute | Description |
keyCode | int | key code |
public getKeyState(keyCode: int): boolean source
get key state of given key code
Params:
Name | Type | Attribute | Description |
keyCode | int | key code |
public keyDownCallback(event: Event): void source
callback for keyDown event
Params:
Name | Type | Attribute | Description |
event | Event |
Return:
void |
public keyUpCallback(event: Event): void source
callback for keyUp event
Params:
Name | Type | Attribute | Description |
event | Event |
Return:
void |
public setEnable(flag: boolean): void source
enable/disable key listener
Params:
Name | Type | Attribute | Description |
flag | boolean | true: enable, false: disable |
Return:
void |