diff --git a/src/binding-set.coffee b/src/binding-set.coffee index 3ce361b2e..431ddae0d 100644 --- a/src/binding-set.coffee +++ b/src/binding-set.coffee @@ -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 diff --git a/src/keymap.coffee b/src/keymap.coffee index 726460403..851aba68d 100644 --- a/src/keymap.coffee +++ b/src/keymap.coffee @@ -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