Minor simplification.

This commit is contained in:
Jürg Lehni 2015-12-20 11:19:04 +01:00
parent 52edd72efb
commit 0346552bc6

View file

@ -63,8 +63,7 @@ var Key = new function() {
// based on whichever key is used for commands.
command: {
get: function() {
var browser = paper.browser;
return browser.mac ? this.meta : this.control;
return paper.browser.mac ? this.meta : this.control;
}
}
});
@ -104,8 +103,7 @@ var Key = new function() {
// Detect modifiers and mark them as pressed / released
if (key.length > 1 && (name = Base.camelize(key)) in modifiers) {
modifiers[name] = down;
var browser = paper.browser;
if (name === 'meta' && browser && browser.mac) {
if (name === 'meta' && paper.browser.mac) {
// Fix a strange behavior on Mac where no keyup events are
// received for any keys pressed while the meta key is down.
// Keep track of the normal keys being pressed and trigger keyup