mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
Use CommandRegistry to listen for native-key-bindings
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user