Skip to content

Commit

Permalink
Add enter key to list of keyboard events detected.
Browse files Browse the repository at this point in the history
  • Loading branch information
spl237 committed Jul 31, 2019
1 parent 5828149 commit 7783dee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/io/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ const KEY_NAME = {
LEFT: 'left arrow',
UP: 'up arrow',
RIGHT: 'right arrow',
DOWN: 'down arrow'
DOWN: 'down arrow',
ENTER: 'enter'
};

/**
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 7783dee

Please sign in to comment.