     @input.value = query + suggestion
     @input.setSelectionRange query.length, query.length + suggestion.length
 
-  # Returns the user's action ("up", "down", "tab", "enter", "dismiss", "delete" or null) based on their
-  # keypress.  We support the arrow keys and various other shortcuts for moving. This method hides that
-  # complexity.
+  # Returns the user's action ("up", "down", "tab", etc, or null) based on their keypress.  We support the
+  # arrow keys and various other shortcuts, and this function hides the event-decoding complexity.
   actionFromKeyEvent: (event) ->
     key = KeyboardUtils.getKeyChar(event)
     if (KeyboardUtils.isEscape(event))

    true

  onKeypress: (event) =>
    unless event.altKey or event.ctrlKey or event.metaKey
      if @inputContainsASelectionRange()
        # As the user types characters which the match prompted text, we suppress the keyboard event and

      return "enter"
    else if event.keyCode == keyCodes.backspace || event.keyCode == keyCodes.deleteKey
      return "delete"
    else if key in [ "left", "right" ] and event.ctrlKey and
        not (event.altKey or event.metaKey or event.shiftKey)
      return "control-#{key}"

    null

  onKeydown: (event) =>
