   $lib_filter = $("#lib-filter")
   $lib_filter.on 'keydown', (event) ->
     event.stopPropagation()
-    switch event.keyCode
+    switch event.which
       when 27
         # if the box is blank, remove focus
         if $(event.target).val().length is 0

  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

    return true if started_drag
    # if any text box has focus, unfocus it
    $(document.activeElement).blur()
    if event.which is 1
      event.preventDefault()
      # selecting / unselecting
      removeContextMenu()
