Ken Aspeslagh
Ken Aspeslagh

Reputation: 11594

Need to receive swipe events in non-key window

In my Cocoa app, I need to handle swipe gestures in a non-key window. Unfortunately, gesture events are only delivered to the key window. Making my window key is not an option.

Any workarounds anyone knows about?

Upvotes: 0

Views: 156

Answers (2)

Ken Aspeslagh
Ken Aspeslagh

Reputation: 11594

Thanks for the note Francis. I wasn't able to find a way to do this. Instead I just used the scrollview's scrollWheel: events and used my own algorithm to detect swipes. Not perfect but seems to work okay.

Upvotes: 0

Francis McGrew
Francis McGrew

Reputation: 7272

The only workaround I've found is to have your window's view watch for mouseEntered: events, and call NSApp's activateIgnoringOtherApps: method. This is not standard behaviour, though.

Upvotes: 1

Related Questions