atom-keymap
Advanced tools
Comparing version 7.0.2 to 7.0.3
34
api.json
@@ -6,3 +6,3 @@ { | ||
"filename": "src/keymap-manager.coffee", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.2/src/keymap-manager.coffee#L66", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.3/src/keymap-manager.coffee#L66", | ||
"sections": [ | ||
@@ -42,3 +42,3 @@ { | ||
"sectionName": "Class Methods", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.2/src/keymap-manager.coffee#L83", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.3/src/keymap-manager.coffee#L83", | ||
"visibility": "Public", | ||
@@ -105,3 +105,3 @@ "summary": "Create a keydown DOM event for testing purposes.", | ||
"sectionName": "Construction and Destruction", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.2/src/keymap-manager.coffee#L109", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.3/src/keymap-manager.coffee#L109", | ||
"visibility": "Public", | ||
@@ -130,3 +130,3 @@ "summary": "Create a new KeymapManager.", | ||
"sectionName": "Construction and Destruction", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.2/src/keymap-manager.coffee#L117", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.3/src/keymap-manager.coffee#L117", | ||
"visibility": "Public", | ||
@@ -139,3 +139,3 @@ "summary": "Clear all registered key bindings and enqueued keystrokes. For use\nin tests. ", | ||
"sectionName": "Construction and Destruction", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.2/src/keymap-manager.coffee#L125", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.3/src/keymap-manager.coffee#L125", | ||
"visibility": "Public", | ||
@@ -148,3 +148,3 @@ "summary": "Unwatch all watched paths. ", | ||
"sectionName": "Event Subscription", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.2/src/keymap-manager.coffee#L151", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.3/src/keymap-manager.coffee#L151", | ||
"visibility": "Public", | ||
@@ -199,3 +199,3 @@ "summary": "Invoke the given callback when one or more keystrokes completely\nmatch a key binding.", | ||
"sectionName": "Event Subscription", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.2/src/keymap-manager.coffee#L167", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.3/src/keymap-manager.coffee#L167", | ||
"visibility": "Public", | ||
@@ -250,3 +250,3 @@ "summary": "Invoke the given callback when one or more keystrokes partially\nmatch a binding.", | ||
"sectionName": "Event Subscription", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.2/src/keymap-manager.coffee#L181", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.3/src/keymap-manager.coffee#L181", | ||
"visibility": "Public", | ||
@@ -295,3 +295,3 @@ "summary": "Invoke the given callback when one or more keystrokes fail to match\nany bindings.", | ||
"sectionName": "Event Subscription", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.2/src/keymap-manager.coffee#L212", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.3/src/keymap-manager.coffee#L212", | ||
"visibility": "Public", | ||
@@ -340,3 +340,3 @@ "summary": "Invoke the given callback when a keymap file not able to be loaded.", | ||
"sectionName": "Adding and Removing Bindings", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.2/src/keymap-manager.coffee#L227", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.3/src/keymap-manager.coffee#L227", | ||
"visibility": "Public", | ||
@@ -369,3 +369,3 @@ "summary": "Add sets of key bindings grouped by CSS selector.", | ||
"sectionName": "Accessing Bindings", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.2/src/keymap-manager.coffee#L266", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.3/src/keymap-manager.coffee#L266", | ||
"visibility": "Public", | ||
@@ -384,3 +384,3 @@ "summary": "Get all current key bindings.", | ||
"sectionName": "Accessing Bindings", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.2/src/keymap-manager.coffee#L281", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.3/src/keymap-manager.coffee#L281", | ||
"visibility": "Public", | ||
@@ -427,3 +427,3 @@ "summary": "Get the key bindings for a given command and optional target.", | ||
"sectionName": "Managing Keymap Files", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.2/src/keymap-manager.coffee#L318", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.3/src/keymap-manager.coffee#L318", | ||
"visibility": "Public", | ||
@@ -464,3 +464,3 @@ "summary": "Load the key bindings from the given path.", | ||
"sectionName": "Managing Keymap Files", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.2/src/keymap-manager.coffee#L341", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.3/src/keymap-manager.coffee#L341", | ||
"visibility": "Public", | ||
@@ -495,3 +495,3 @@ "summary": "Cause the keymap to reload the key bindings file at the given path\nwhenever it changes.", | ||
"sectionName": "Managing Keyboard Events", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.2/src/keymap-manager.coffee#L413", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.3/src/keymap-manager.coffee#L413", | ||
"visibility": "Public", | ||
@@ -512,3 +512,3 @@ "summary": "Dispatch a custom event associated with the matching key binding for\nthe given `KeyboardEvent` if one can be found.", | ||
"sectionName": "Managing Keyboard Events", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.2/src/keymap-manager.coffee#L625", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.3/src/keymap-manager.coffee#L625", | ||
"visibility": "Public", | ||
@@ -535,3 +535,3 @@ "summary": "Translate a keydown event to a keystroke string.", | ||
"sectionName": "Managing Keyboard Events", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.2/src/keymap-manager.coffee#L632", | ||
"srcUrl": "https://github.com/atom/atom-keymap/blob/v7.0.3/src/keymap-manager.coffee#L632", | ||
"visibility": "Public", | ||
@@ -538,0 +538,0 @@ "summary": "Get the number of milliseconds allowed before pending states caused\nby partial matches of multi-keystroke bindings are terminated.", |
(function() { | ||
var ENDS_IN_MODIFIER_REGEX, KeyboardLayout, MATCH_TYPES, MODIFIERS, NON_CHARACTER_KEY_NAMES_BY_KEYBOARD_EVENT_KEY, WHITESPACE_REGEX, buildKeyboardEvent, calculateSpecificity, isASCIICharacter, isLatinCharacter, isLowerCaseCharacter, isUpperCaseCharacter, nonAltModifiedKeyForKeyboardEvent, normalizeKeystroke, parseKeystroke, usCharactersForKeyCode, usKeymap; | ||
var ENDS_IN_MODIFIER_REGEX, KEY_NAMES_BY_KEYBOARD_EVENT_CODE, KeyboardLayout, MATCH_TYPES, MODIFIERS, NON_CHARACTER_KEY_NAMES_BY_KEYBOARD_EVENT_KEY, WHITESPACE_REGEX, buildKeyboardEvent, calculateSpecificity, isASCIICharacter, isLatinCharacter, isLowerCaseCharacter, isUpperCaseCharacter, nonAltModifiedKeyForKeyboardEvent, normalizeKeystroke, parseKeystroke, usCharactersForKeyCode, usKeymap; | ||
@@ -14,2 +14,6 @@ calculateSpecificity = require('clear-cut').calculateSpecificity; | ||
KEY_NAMES_BY_KEYBOARD_EVENT_CODE = { | ||
'Space': 'space' | ||
}; | ||
NON_CHARACTER_KEY_NAMES_BY_KEYBOARD_EVENT_KEY = { | ||
@@ -153,4 +157,4 @@ 'Control': 'ctrl', | ||
exports.keystrokeForKeyboardEvent = function(event) { | ||
var altKey, characters, ctrlKey, isNonCharacterKey, key, keystroke, metaKey, nonAltModifiedKey, shiftKey, _ref; | ||
key = event.key, ctrlKey = event.ctrlKey, altKey = event.altKey, shiftKey = event.shiftKey, metaKey = event.metaKey; | ||
var altKey, characters, code, ctrlKey, isNonCharacterKey, key, keystroke, metaKey, nonAltModifiedKey, shiftKey, _ref; | ||
key = event.key, code = event.code, ctrlKey = event.ctrlKey, altKey = event.altKey, shiftKey = event.shiftKey, metaKey = event.metaKey; | ||
if (key === 'Dead') { | ||
@@ -171,5 +175,8 @@ if (process.platform !== 'linux' && (characters = KeyboardLayout.getCurrentKeymap()[event.code])) { | ||
} | ||
if (KEY_NAMES_BY_KEYBOARD_EVENT_CODE[code] != null) { | ||
key = KEY_NAMES_BY_KEYBOARD_EVENT_CODE[code]; | ||
} | ||
isNonCharacterKey = key.length > 1; | ||
if (isNonCharacterKey) { | ||
key = (_ref = NON_CHARACTER_KEY_NAMES_BY_KEYBOARD_EVENT_KEY[event.key]) != null ? _ref : event.key.toLowerCase(); | ||
key = (_ref = NON_CHARACTER_KEY_NAMES_BY_KEYBOARD_EVENT_KEY[key]) != null ? _ref : key.toLowerCase(); | ||
} else { | ||
@@ -199,3 +206,3 @@ if (altKey) { | ||
} | ||
if ((!isLatinCharacter(key) && (ctrlKey || altKey || metaKey)) || (metaKey && KeyboardLayout.getCurrentKeyboardLayout() === 'com.apple.keylayout.DVORAK-QWERTYCMD')) { | ||
if ((key.length === 1 && !isLatinCharacter(key)) || (metaKey && KeyboardLayout.getCurrentKeyboardLayout() === 'com.apple.keylayout.DVORAK-QWERTYCMD')) { | ||
if (characters = usCharactersForKeyCode(event.code)) { | ||
@@ -202,0 +209,0 @@ if (event.shiftKey) { |
{ | ||
"name": "atom-keymap", | ||
"version": "7.0.2", | ||
"version": "7.0.3", | ||
"description": "Atom's DOM-aware keymap module", | ||
@@ -5,0 +5,0 @@ "main": "./lib/keymap-manager", |
72609
1765