mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-01-11 10:39:56 -05:00
Merge pull request #2247 from spl237/keyboard
Add enter key to list of keyboard events detected.
This commit is contained in:
commit
0052383657
1 changed files with 3 additions and 1 deletions
|
@ -9,7 +9,8 @@ const KEY_NAME = {
|
||||||
LEFT: 'left arrow',
|
LEFT: 'left arrow',
|
||||||
UP: 'up arrow',
|
UP: 'up arrow',
|
||||||
RIGHT: 'right 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 'ArrowRight': return KEY_NAME.RIGHT;
|
||||||
case 'Down':
|
case 'Down':
|
||||||
case 'ArrowDown': return KEY_NAME.DOWN;
|
case 'ArrowDown': return KEY_NAME.DOWN;
|
||||||
|
case 'Enter': return KEY_NAME.ENTER;
|
||||||
}
|
}
|
||||||
// Ignore modifier keys
|
// Ignore modifier keys
|
||||||
if (keyString.length > 1) {
|
if (keyString.length > 1) {
|
||||||
|
|
Loading…
Reference in a new issue