     @subscribeToCommand $(document), 'core:focus-next', @focusNext
     @subscribeToCommand $(document), 'core:focus-previous', @focusPrevious
 
-    @subscribe $(document), 'keydown', keymap.handleKeyEvent
+    @subscribe $(document), 'keydown', atom.keymap.handleKeyEvent
 
     @subscribe $(document), 'drop', onDrop
     @subscribe $(document), 'dragover', (e) ->

  openLink: (event) =>
    location = $(event.target).attr('href')
    if location and location[0] isnt '#' and /^https?:\/\//.test(location)
      require('shell').openExternal(location)
    false

  eachTabIndexedElement: (callback) ->

    @subscribe $(window), 'focus', -> $("body").removeClass('is-blurred')
    @subscribe $(window), 'blur',  -> $("body").addClass('is-blurred')
    @subscribe $(window), 'window:open-path', (event, {pathToOpen, initialLine}) ->
      atom.rootView?.open(pathToOpen, {initialLine}) unless fsUtils.isDirectorySync(pathToOpen)
    @subscribe $(window), 'beforeunload', =>
      confirmed = atom.rootView?.confirmClose()
      atom.hide() if confirmed and not @reloadRequested and atom.getCurrentWindow().isWebViewFocused()
      @reloadRequested = false
      confirmed
    @subscribe $(window), 'unload', ->
