Constructor
new KeyboardManager()
Members
_downKeys :Set
The set of key codes which are currently depressed (down)
Type:
- Set
_handled :Set
The set of key codes which have been already handled per workflow
Type:
- Set
DIGIT_KEYS :Array.<string>
Enumerate the "digit keys"
Type:
- Array.<string>
digitKeys
The key codes which represent a digit key
hasFocus
Test whether an input currently has focus
MOUSE_WHEEL_RATE_LIMIT :number
Specify a rate limit for mouse wheel to gate repeated scrolling. This is especially important for continuous scrolling mice which emit hundreds of events per second. This designates a minimum number of milliseconds which must pass before another wheel event is handled
Type:
- number
moveKeys
The key codes which represent a possible movement key
MOVEMENT_KEYS :Array.<string>
Map keys used for movement
Type:
- Array.<string>
ZOOM_KEYS :string
Map keys used for canvas zooming
Type:
- string
zoomKeys
Return the key codes used for zooming the canvas
Methods
_handleCanvasPan()
Handle panning the canvas using CTRL + directional keys
_onCompositionEnd(event)
Input events do not fire with isComposing = false at the end of a composition event in Chrome See: https://github.com/w3c/uievents/issues/202
Parameters:
Name | Type | Description |
---|---|---|
event |
CompositionEvent |
getKey(event) → {string}
Get a standardized keyboard code for a given event
Parameters:
Name | Type | Description |
---|---|---|
event |
KeyboardEvent | The originating keypress event |
Returns:
The standardized string code to use
- Type
- string
isCtrl(event) → {boolean}
A helper method to test whether, given an Event, the CTRL (or CMD) keys are pressed
Parameters:
Name | Type | Description |
---|---|---|
event |
Event | PIXI.InteractionEvent | The originating event or canvas interaction |
Returns:
- Type
- boolean
isDown(code)
Return whether the key code is currently in the DOWN state
Parameters:
Name | Type | Description |
---|---|---|
code |
string | The key code to test |