Hi there,
I recently bought a Space Navigator for Notebooks and I want to integrate its functionality in an application.
The idea is to get something that supports multiple devices as well. I see that is possible with the Max OS X API.
I am writing some driver code to capture the data sent by the SN and I run into a problem.
When the app in question is not the frontmost app I stop receiving data from the SN.
If I initialize the device with the following code:
clientID = RegisterConnexionClient('max2', NULL, kConnexionClientModeTakeOver, kConnexionMaskAll);
I receive data normally, but only if the app is frontmost.
This is the code that - according to the docs - should allow me to receive data no matter if the app is frontmost or in the background:
clientID = RegisterConnexionClient(kConnexionClientWildcard, NULL, kConnexionClientModeTakeOver, kConnexionMaskAll);
However, in this case I don't receive anything at all.
What am I doing wrong ?
Thanks.
- Luigi Castelli
Space Navigator for Notebooks working in a background app
Moderator: Moderators
-
- Posts: 18
- Joined: Thu Jan 25, 2007 1:11 pm
- Location: Los Angeles
-
- Posts: 18
- Joined: Thu Jan 25, 2007 1:11 pm
- Location: Los Angeles
ok, nevermind... my bad.
I was doing something silly and figured out the mistake.
Now, just to clarify:
if I register my client as follows:
clientID = RegisterConnexionClient('max2', NULL, kConnexionClientModeTakeOver, kConnexionMaskAll);
then I only receive events when my application ('max2') is in focus,
whereas, if I use:
clientID = RegisterConnexionClient(kConnexionClientWildcard, NULL, kConnexionClientModeTakeOver, kConnexionMaskAll);
then I receive events whether we are in focus or not. Correct ?
In this mode why would I need a client ID ? Can I safely disregard it ?
Thanks.
- Luigi Castelli
I was doing something silly and figured out the mistake.
Now, just to clarify:
if I register my client as follows:
clientID = RegisterConnexionClient('max2', NULL, kConnexionClientModeTakeOver, kConnexionMaskAll);
then I only receive events when my application ('max2') is in focus,
whereas, if I use:
clientID = RegisterConnexionClient(kConnexionClientWildcard, NULL, kConnexionClientModeTakeOver, kConnexionMaskAll);
then I receive events whether we are in focus or not. Correct ?
In this mode why would I need a client ID ? Can I safely disregard it ?
Thanks.
- Luigi Castelli
-
- Posts: 18
- Joined: Thu Jan 25, 2007 1:11 pm
- Location: Los Angeles