Fixes https://github.com/PurpleKingdomGames/indigo/issues/766 by adding a new KeyCode enum, which is populated with the values from the code property of the KeyboardEvent. Additionally, the Key class also has a new location property, which maps to the location property of the KeyboardEvent.
All Key.*_ARROW constants are now Key.ARROW_* to bring it in line with the key codes that they relate to:
Key.UP_ARROW is now Key.ARROW_UP
Key.DOWN_ARROW is now Key.ARROW_DOWN
Key.LEFT_ARROW is now Key.ARROW_LEFT
Key.RIGHT_ARROW is now Key.ARROW_RIGHT
The KeyboardEvent itself now also supports some new additional properties:
isRepeat - a boolean indicating if the key is being held down
isCtrlKeyDown - a boolean indicating if the Ctrl key is pressed
isMetaKeyDown - a boolean indicating if the Meta key is pressed
isAltKeyDown - a boolean indicating if the Alt key is pressed
isShiftKeyDown - a boolean indicating if the Shift key is pressed
Additionally adds isNumeric and asNumeric methods to Key in order to fulfill #746
This is a breaking change
Fixes https://github.com/PurpleKingdomGames/indigo/issues/766 by adding a new
KeyCode
enum, which is populated with the values from thecode
property of the KeyboardEvent. Additionally, theKey
class also has a newlocation
property, which maps to thelocation
property of the KeyboardEvent.All
Key.*_ARROW
constants are nowKey.ARROW_*
to bring it in line with the key codes that they relate to:Key.UP_ARROW
is nowKey.ARROW_UP
Key.DOWN_ARROW
is nowKey.ARROW_DOWN
Key.LEFT_ARROW
is nowKey.ARROW_LEFT
Key.RIGHT_ARROW
is nowKey.ARROW_RIGHT
The KeyboardEvent itself now also supports some new additional properties:
isRepeat
- a boolean indicating if the key is being held downisCtrlKeyDown
- a boolean indicating if the Ctrl key is pressedisMetaKeyDown
- a boolean indicating if the Meta key is pressedisAltKeyDown
- a boolean indicating if the Alt key is pressedisShiftKeyDown
- a boolean indicating if the Shift key is pressedAdditionally adds
isNumeric
andasNumeric
methods toKey
in order to fulfill #746