   $chat_input = $("#chat-input")
   $chat_input.on 'keydown', (event) ->
     event.stopPropagation()
-    if event.keyCode is 27
+    if event.which is 27
       $(event.target).blur()
       return false
-    else if event.keyCode is 13
+    else if event.which is 13
       message = $.trim($(event.target).val())
       Util.wait 0, ->
         $(event.target).val("")

  libraryMouseDown = (event, sel_name, key) ->
    # if any text box has focus, unfocus it
    $(document.activeElement).blur()
    if event.button is 0
      event.preventDefault()
      removeContextMenu()
      skip_drag = false

            # we didn't end up dragging, select the item
            selection.selectOnly 'playlist', track_id
            refreshSelection()
    else if event.which is 3
      return if event.altKey
      event.preventDefault()

