   pushKeyChar: (keyChar) -> @hintKeystrokeQueue.push keyChar
   popKeyChar: -> @hintKeystrokeQueue.pop()
 
-  deactivate: -> @hintKeystrokeQueue = []
-
-filterHints =
-  activateOnEnter: true
-  hintKeystrokeQueue: []
-  linkTextKeystrokeQueue: []
-  labelMap: {}
+# Use numbers (usually) for hints, and also filter links by their text.
+class FilterHints
+  constructor: ->
+    @activateOnEnter = true
+    @hintKeystrokeQueue = []
+    @linkTextKeystrokeQueue = []
+    @labelMap = {}
 
   #
   # Generate a map of input element => label

  #
  showMarker: (linkMarker, matchingCharCount) ->
    linkMarker.style.display = ""
    # TODO(philc):
    for j in [0...linkMarker.childNodes.length]
      if (j < matchingCharCount)
        linkMarker.childNodes[j].classList.add("matchingCharacter")

  # 'callback' is invoked (if it is provided).
  deactivateMode: (delay, callback) ->
    deactivate = =>
      DomUtils.removeElement @hintMarkerContainingDiv if @hintMarkerContainingDiv
      @hintMarkerContainingDiv = null
      @markerMatcher = null
      @isActive = false
      @hintMode?.exit()
      @hintMode = null
