views:

27

answers:

1

How can I use touch events not limited to a specific view? I want to use those events for an background app and found out that I only can enable touch events for a view by using setAcceptsTouchEvents:

Thanks in advance, Philip

A: 

You could try overriding the application's sendEvent: method, but I doubt that will work, as it's for events within your own application. For an application that's always in the background, you won't get any such events.

The usual solution would be to install a CGEventTap, but since Quartz Event Services doesn't have event constants for touches, swipes, etc., I don't think you can do that.

The only other way I can think of might be to go through I/O Kit's HID layer; I have no idea specifically what you'll have to do to use that.

You probably should file an enhancement request in RadarWeb to ask for a higher-level solution (such as touch event support in CGEventTap).

Peter Hosey
Ok, Thanks for your answer. But how's that made in the Chinese handwriting input in Snow Leopard?
Ph99Ph
I have no idea.
Peter Hosey
Hmm. Thanks anyway.
Ph99Ph