From 8dbb9cfd557830fda06b57206aa36a6fef0cf6d3 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 24 Nov 2015 16:24:51 +0100 Subject: [PATCH] Use CommandRegistry to listen for native-key-bindings --- src/window-event-handler.coffee | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/window-event-handler.coffee b/src/window-event-handler.coffee index c786f7e9c..d3a231f77 100644 --- a/src/window-event-handler.coffee +++ b/src/window-event-handler.coffee @@ -42,9 +42,8 @@ class WindowEventHandler # `.native-key-bindings` class. handleNativeKeybindings: -> bindCommandToAction = (command, action) => - @addEventListener @document, command, (event) => - if event.target.webkitMatchesSelector('.native-key-bindings') - @applicationDelegate.getCurrentWindow().webContents[action]() + @subscriptions.add @atomEnvironment.commands.add '.native-key-bindings', command, (event) => + @applicationDelegate.getCurrentWindow().webContents[action]() bindCommandToAction('core:copy', 'copy') bindCommandToAction('core:paste', 'paste')