mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 14:10:14 -05:00
Minor simplification.
This commit is contained in:
parent
52edd72efb
commit
0346552bc6
1 changed files with 2 additions and 4 deletions
|
@ -63,8 +63,7 @@ var Key = new function() {
|
||||||
// based on whichever key is used for commands.
|
// based on whichever key is used for commands.
|
||||||
command: {
|
command: {
|
||||||
get: function() {
|
get: function() {
|
||||||
var browser = paper.browser;
|
return paper.browser.mac ? this.meta : this.control;
|
||||||
return browser.mac ? this.meta : this.control;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -104,8 +103,7 @@ var Key = new function() {
|
||||||
// Detect modifiers and mark them as pressed / released
|
// Detect modifiers and mark them as pressed / released
|
||||||
if (key.length > 1 && (name = Base.camelize(key)) in modifiers) {
|
if (key.length > 1 && (name = Base.camelize(key)) in modifiers) {
|
||||||
modifiers[name] = down;
|
modifiers[name] = down;
|
||||||
var browser = paper.browser;
|
if (name === 'meta' && paper.browser.mac) {
|
||||||
if (name === 'meta' && browser && browser.mac) {
|
|
||||||
// Fix a strange behavior on Mac where no keyup events are
|
// Fix a strange behavior on Mac where no keyup events are
|
||||||
// received for any keys pressed while the meta key is down.
|
// received for any keys pressed while the meta key is down.
|
||||||
// Keep track of the normal keys being pressed and trigger keyup
|
// Keep track of the normal keys being pressed and trigger keyup
|
||||||
|
|
Loading…
Reference in a new issue