Add enter key to list of keyboard events detected.

This commit is contained in:
Simon Long 2019-07-31 07:23:35 +01:00
parent 5828149827
commit 7783deecf6

View file

@ -9,7 +9,8 @@ const KEY_NAME = {
LEFT: 'left arrow',
UP: 'up arrow',
RIGHT: 'right arrow',
DOWN: 'down arrow'
DOWN: 'down arrow',
ENTER: 'enter'
};
/**
@ -56,6 +57,7 @@ class Keyboard {
case 'ArrowRight': return KEY_NAME.RIGHT;
case 'Down':
case 'ArrowDown': return KEY_NAME.DOWN;
case 'Enter': return KEY_NAME.ENTER;
}
// Ignore modifier keys
if (keyString.length > 1) {