I’m writing an application that will use your’s phone as touchpad and simulate different touchpad’s gestures by swift code on Mac. But when I’ve tried to implement swiping between workspaces (same as three fingers swipe touchpad) due to it is possible to invoke with <kbd>control + arrow</kbd> I faced with problem of invoking key press.
I’ve looked up to this discussion and wrote it is like
func rightScreen(){
let key = CGEvent(keyboardEventSource: nil, virtualKey: 0x7C, keyDown: true)
key?.flags = .maskControl
key?.post(tap: .cghidEventTap)
}
but it works just like simple arrow click. How can I make it work right
BrainPumpkin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.