mirror of
https://github.com/atom/atom.git
synced 2026-01-24 06:18:03 -05:00
Expose minimal interface for viewing keymap
This commit is contained in:
@@ -23,6 +23,14 @@ class BindingSet
|
||||
@selector = selector.replace(/!important/g, '')
|
||||
@commandsByKeystrokes = @normalizeCommandsByKeystrokes(commandsByKeystrokes)
|
||||
|
||||
# Public:
|
||||
getSelector: ->
|
||||
@selector
|
||||
|
||||
# Public:
|
||||
getCommandsByKeystrokes: ->
|
||||
@commandsByKeystrokes
|
||||
|
||||
commandForEvent: (event) ->
|
||||
for keystrokes, command of @commandsByKeystrokes
|
||||
return command if event.keystrokes == keystrokes
|
||||
|
||||
@@ -54,6 +54,10 @@ class Keymap
|
||||
keystroke = keystrokes.split(' ')[0]
|
||||
_.remove(@bindingSetsByFirstKeystroke[keystroke], bindingSet)
|
||||
|
||||
# Public: Returns all registered {BindingSet}s.
|
||||
getBindingSets: ->
|
||||
@bindingSets
|
||||
|
||||
bindKeys: (args...) ->
|
||||
name = args.shift() if args.length > 2
|
||||
[selector, bindings] = args
|
||||
|
||||
Reference in New Issue
Block a user