Hi,
I am working with a Space Navigator for Notebooks and I was wondering how to turn the LED on/off programmatically.
I am on a MacBookPro running Mac OS X 10.6.7 with the latest 3Dconnexion driver installed.
The code I have is the following but it produces no results:
OSErr err;
SInt32 param = 1; // or 0 to turn it off
err = ConnexionClientControl(clientID, kConnexionCtlSetLEDState, param, NULL);
if (err) {
error( "failed to send control command to 3Dconnexion driver");
}
Can someone point me in the right direction ?
Thank you.
- Luigi Castelli
Space Navigator for Notebooks - how to turn on/off LED
Moderator: Moderators
-
- Posts: 18
- Joined: Thu Jan 25, 2007 1:11 pm
- Location: Los Angeles
Hi,
param is a 32-bit coded integer. The low word is the requested LED state, the high word is the mask for LEDs to modify.
In SpaceNavigator and SpaceNavigator for Notebooks, we only have one logical LED and it's number 1 so you'd use something like:
state = 0x0001 or 0x0000
mask = 0x0001
message to turn LED on = (0x0001 << 16) | 0x0001 = 0x00010001
message to turn LED off = (0x0001 << 16) | 0x0000 = 0x00010000
param is a 32-bit coded integer. The low word is the requested LED state, the high word is the mask for LEDs to modify.
In SpaceNavigator and SpaceNavigator for Notebooks, we only have one logical LED and it's number 1 so you'd use something like:
state = 0x0001 or 0x0000
mask = 0x0001
message to turn LED on = (0x0001 << 16) | 0x0001 = 0x00010001
message to turn LED off = (0x0001 << 16) | 0x0000 = 0x00010000
-
- 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
distinguishing between multiple space navigators
you might be able to tell the difference by their usb bus address -- e.g. mine is currently connected to 0xFA140000... my other USB port is at 0xFD130000. If there's no carrier with the incoming interrupt you could probably turn off one port, recheck the interrupt, turn the port back on and the other port off, recheck the interrupt, and determine which device is the caller that way. just brainstorming
Re:
flomotan wrote:Hi,
param is a 32-bit coded integer. The low word is the requested LED state, the high word is the mask for LEDs to modify.
In SpaceNavigator and SpaceNavigator for Notebooks, we only have one logical LED and it's number 1 so you'd use something like:
state = 0x0001 or 0x0000
mask = 0x0001
message to turn LED on = (0x0001 << 16) | 0x0001 = 0x00010001
message to turn LED off = (0x0001 << 16) | 0x0000 = 0x00010000
Thanks for useful info