atom-keymap
Advanced tools
Comparing version 0.12.0 to 0.13.0
@@ -74,2 +74,5 @@ (function() { | ||
} | ||
if (key === "meta" || key === "shift" || key === "control" || key === "alt") { | ||
key = null; | ||
} | ||
if (event.metaKey) { | ||
@@ -76,0 +79,0 @@ keystroke.push('cmd'); |
(function() { | ||
var CSON, CommandEvent, Emitter, File, KeyBinding, Keymap, OtherPlatforms, Platforms, fs, isAtomModifier, keydownEvent, keystrokeForKeyboardEvent, normalizeKeystrokes, path, _ref, | ||
var CSON, CommandEvent, Emitter, File, KeyBinding, Keymap, OtherPlatforms, Platforms, fs, isAtomModifier, keydownEvent, keystrokeForKeyboardEvent, normalizeKeystrokes, path, _, _ref, | ||
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; | ||
_ = require("underscore-plus"); | ||
CSON = require('season'); | ||
@@ -138,3 +140,3 @@ | ||
Keymap.prototype.handleKeyboardEvent = function(event, replaying) { | ||
var currentTarget, enableTimeout, exactMatch, exactMatchCandidates, foundMatch, keystroke, keystrokes, partialMatchCandidates, partialMatches, target, _i, _len, _ref1, _ref2; | ||
var currentTarget, enableTimeout, exactMatch, exactMatchCandidates, exactMatches, foundMatch, keystroke, keystrokes, partialMatchCandidates, partialMatches, target, _i, _len, _ref1; | ||
keystroke = this.keystrokeForKeyboardEvent(event); | ||
@@ -157,5 +159,5 @@ if (this.queuedKeystrokes.length > 0 && isAtomModifier(keystroke)) { | ||
while ((currentTarget != null) && currentTarget !== document) { | ||
_ref2 = this.findExactMatches(exactMatchCandidates, currentTarget); | ||
for (_i = 0, _len = _ref2.length; _i < _len; _i++) { | ||
exactMatch = _ref2[_i]; | ||
exactMatches = this.findExactMatches(exactMatchCandidates, currentTarget); | ||
for (_i = 0, _len = exactMatches.length; _i < _len; _i++) { | ||
exactMatch = exactMatches[_i]; | ||
if (exactMatch.command === 'native!') { | ||
@@ -172,2 +174,7 @@ this.clearQueuedKeystrokes(); | ||
if (this.dispatchCommandEvent(exactMatch.command, target, event)) { | ||
this.emit('matched', { | ||
keystrokes: keystrokes, | ||
binding: exactMatch, | ||
keyboardEventTarget: target | ||
}); | ||
return; | ||
@@ -182,4 +189,13 @@ } | ||
enableTimeout = foundMatch != null ? foundMatch : this.pendingStateTimeoutHandle != null; | ||
return this.enterPendingState(partialMatches, enableTimeout); | ||
this.enterPendingState(partialMatches, enableTimeout); | ||
return this.emit('matched-partially', { | ||
keystrokes: keystrokes, | ||
partiallyMatchedBindings: partialMatches, | ||
keyboardEventTarget: target | ||
}); | ||
} else { | ||
this.emit('match-failed', { | ||
keystrokes: keystrokes, | ||
keyboardEventTarget: target | ||
}); | ||
return this.terminatePendingState(); | ||
@@ -186,0 +202,0 @@ } |
{ | ||
"name": "atom-keymap", | ||
"version": "0.12.0", | ||
"version": "0.13.0", | ||
"description": "Atom's DOM-aware keymap module", | ||
@@ -30,3 +30,4 @@ "main": "./lib/keymap", | ||
"pathwatcher": "^1.0.0", | ||
"emissary": "^1.1.0" | ||
"emissary": "^1.1.0", | ||
"underscore-plus": "^1.0.0" | ||
}, | ||
@@ -33,0 +34,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37380
985
8
+ Addedunderscore-plus@^1.0.0