     @input = @box.querySelector("input")
     @input.addEventListener "input", @updateOnInput
     @input.addEventListener "keydown", @onKeydown
+    @input.addEventListener "keypress", @onKeypress
     @completionList = @box.querySelector("ul")
     @completionList.style.display = ""
 

    event.preventDefault()
    true

  # Test whether the input contains selected text.
  inputContainsASelectionRange: ->
    @input.selectionStart? and @input.selectionEnd? and @input.selectionStart != @input.selectionEnd

  # Return the background-page query corresponding to the current input state.  In other words, reinstate any
  # custom search engine keyword which is currently stripped from the input.
  getInputValueAsQuery: ->
    (if @suppressedLeadingKeyword? then @suppressedLeadingKeyword + " " else "") + @getInputWithoutSelectionRange()

  updateCompletions: (callback = null) ->
    @completer.filter @getInputValueAsQuery(), (response) =>
