From a4a0a9be2eee338817c7b9d51e74352ac14e645d Mon Sep 17 00:00:00 2001 From: Louis Pontoise Date: Mon, 28 Oct 2019 13:11:08 +0900 Subject: [PATCH] refactor: keyboard event listening should be read-only --- alt-tab-macos/logic/Keyboard.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alt-tab-macos/logic/Keyboard.swift b/alt-tab-macos/logic/Keyboard.swift index 97e8c4c7..c1d1f7d7 100644 --- a/alt-tab-macos/logic/Keyboard.swift +++ b/alt-tab-macos/logic/Keyboard.swift @@ -27,8 +27,8 @@ func listenToGlobalKeyboardEvents(_ delegate: Application) { eventTap = CGEvent.tapCreate( tap: .cgSessionEventTap, place: .headInsertEventTap, - options: .defaultTap, - eventsOfInterest: CGEventMask(eventMask), + options: .listenOnly, + eventsOfInterest: eventMask, callback: { (_, _, event, delegate_) -> Unmanaged? in let d = Unmanaged.fromOpaque(delegate_!).takeUnretainedValue() return keyboardHandler(event, d)