mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
parent
6ddf112b39
commit
95bcdac57c
1 changed files with 10 additions and 5 deletions
|
@ -40,7 +40,7 @@ var Key = new function() {
|
||||||
224: 'command' // Gecko command button
|
224: 'command' // Gecko command button
|
||||||
},
|
},
|
||||||
|
|
||||||
// Mark the special skeys that still can be interpreted as chars too
|
// Mark the special keys that still can be interpreted as chars too
|
||||||
specialChars = {
|
specialChars = {
|
||||||
9: true, // tab
|
9: true, // tab
|
||||||
13: true, // enter
|
13: true, // enter
|
||||||
|
@ -107,10 +107,15 @@ var Key = new function() {
|
||||||
// If the keyCode is in keys, it needs to be handled by keydown and
|
// If the keyCode is in keys, it needs to be handled by keydown and
|
||||||
// not in keypress after (arrows for example wont be triggering
|
// not in keypress after (arrows for example wont be triggering
|
||||||
// a keypress, but space would).
|
// a keypress, but space would).
|
||||||
if (code in specialKeys) {
|
// The same applies when pressing the command / meta key, as we
|
||||||
// No char code for special keys (except the ones listed in
|
// won't get a keypress event for these combos.
|
||||||
// specialChars), but mark as pressed by setting to 0.
|
if (code in specialKeys || modifiers.command) {
|
||||||
handleKey(true, code, code in specialChars ? code : 0, event);
|
handleKey(true, code,
|
||||||
|
// No char code for special keys (except the ones listed
|
||||||
|
// in specialChars, or when pressing command modifier),
|
||||||
|
// but mark as pressed by setting to 0.
|
||||||
|
code in specialChars || modifiers.command ? code : 0,
|
||||||
|
event);
|
||||||
// Do not set downCode as we handled it already. Space would
|
// Do not set downCode as we handled it already. Space would
|
||||||
// be handled twice otherwise, once here, once in keypress.
|
// be handled twice otherwise, once here, once in keypress.
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue