-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Capture Magic Mouse tap gestures #28
Comments
Currently, it only intercepts keyboard events: Keyboard/keyboard/AppDelegate.swift Line 73 in 75dfa78
If you want to handle click events, include |
Hi and many thanks for the suggestion. I´ve tried adding your suggested code, and even |
Please read the code more carefully. index 961a81b..9a94825 100644
--- a/keyboard/AppComponent.swift
+++ b/keyboard/AppComponent.swift
@@ -20,6 +20,8 @@ final class AppComponent {
if let manager = _eventManager {
return manager.handle(proxy: proxy, cgEvent: event)
}
+ case .leftMouseDown:
+ print("leftMouseDown!")
default:
break
}
diff --git a/keyboard/AppDelegate.swift b/keyboard/AppDelegate.swift
index bc39af6..84303b7 100644
--- a/keyboard/AppDelegate.swift
+++ b/keyboard/AppDelegate.swift
@@ -70,7 +70,7 @@ private extension AppDelegate {
}
func setupEventTap() {
- let eventMask = (1 << CGEventType.keyDown.rawValue) | (1 << CGEventType.keyUp.rawValue)
+ let eventMask = (1 << CGEventType.keyDown.rawValue) | (1 << CGEventType.keyUp.rawValue) | (1 << CGEventType.leftMouseDown.rawValue)
guard let eventTap = CGEvent.tapCreate(
tap: .cghidEventTap, |
Fantastic, thank you! (I missed the AppComponent.swift part, I am sorry and I apologize) |
Hi and thanks for open sourcing this awesome tool!
Question: Is it possible to capture Magic Mouse tap gestures (e.g. to simulate tap-to-click)? I´ve tried adding a "print(action)" on line 39 on EventManager.swift, and it seems only keyboard actions trigger anything to the output terminal. Please advise.
Thanks again and best regards.
The text was updated successfully, but these errors were encountered: