 module.exports =
 class Keymap
   bindingSets: null
+  bindingSetsByFirstKeystroke: null
   queuedKeystrokes: null
 
   constructor: ->
     @bindingSets = []
+    @bindingSetsByFirstKeystroke = {}
 
   bindDefaultKeys: ->
     @bindKeys "*",

    event.keystrokes = @multiKeystrokeStringForEvent(event)
    isMultiKeystroke = @queuedKeystrokes?
    @queuedKeystrokes = null
    currentNode = $(event.target)
    while currentNode.length
      candidateBindingSets = @bindingSetsForNode(currentNode)
      for bindingSet in candidateBindingSets
        command = bindingSet.commandForEvent(event)
        if command


    !isMultiKeystroke

  bindingSetsForNode: (node, candidateBindingSets = @bindingSets) ->
    bindingSets = candidateBindingSets.filter (set) -> node.is(set.selector)
    bindingSets.sort (a, b) ->
      if b.specificity == a.specificity
        b.index - a.index
