Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Way to get beginGestureWithEvent/endGestureWithEvent if window isn't frontmost

Is there a way to get

- (void)beginGestureWithEvent:(NSEvent *)event

and

- (void)endGestureWithEvent:(NSEvent *)event

calls to a view even if the containing window is in the background? It seems these calls are only delivered to windows if they are key.

like image 801
Loren Avatar asked Nov 04 '22 23:11

Loren


1 Answers

In general no. In Leopard and SnowLeopard, gestures are intended to target only the foreground window. As you discovered, the window server will not even send gesture events to background applications.

You could instal an event tap, but those events don't look exactly their the NS equivalents. All the data is there, though, if you really want to dig into it.

Please file a radar asking for this along with why this would be useful.

like image 51
Raleigh Avatar answered Nov 16 '22 05:11

Raleigh