mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-07-29 07:09:45 -04:00
paper.browser can still be null when the first key events fire.
This commit is contained in:
parent
79508ff78b
commit
cb3d4341fd
1 changed files with 2 additions and 2 deletions
|
@ -147,9 +147,9 @@ var Key = new function() {
|
||||||
// not all of them will receive keypress events.
|
// not all of them will receive keypress events.
|
||||||
// Chrome doesn't fire keypress events for command and alt keys,
|
// Chrome doesn't fire keypress events for command and alt keys,
|
||||||
// so we need to handle this in a way that works across all OSes.
|
// so we need to handle this in a way that works across all OSes.
|
||||||
if (key.length > 1 || browser.chrome && (event.altKey
|
if (key.length > 1 || browser && (browser.chrome && (event.altKey
|
||||||
|| browser.mac && event.metaKey
|
|| browser.mac && event.metaKey
|
||||||
|| !browser.mac && event.ctrlKey)) {
|
|| !browser.mac && event.ctrlKey))) {
|
||||||
handleKey(true, key,
|
handleKey(true, key,
|
||||||
charLookup[key] || (key.length > 1 ? '' : key), event);
|
charLookup[key] || (key.length > 1 ? '' : key), event);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue