Space Navigator for Notebooks - how to turn on/off LED

Post questions, comments and feedback to our 3Dconnexion Mac Development Team.

Moderator: Moderators

Post Reply
superbigio
Posts: 18
Joined: Thu Jan 25, 2007 1:11 pm
Location: Los Angeles

Space Navigator for Notebooks - how to turn on/off LED

Post by superbigio »

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
flomotan
Moderator
Moderator
Posts: 287
Joined: Mon Jan 08, 2007 3:37 pm

Post by flomotan »

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
superbigio
Posts: 18
Joined: Thu Jan 25, 2007 1:11 pm
Location: Los Angeles

Post by superbigio »

yes, works like a charm.

Thank you.

- Luigi
superbigio
Posts: 18
Joined: Thu Jan 25, 2007 1:11 pm
Location: Los Angeles

Post by superbigio »

sorry, I just thought of something else...

In case of multiple Space Navigators connected is it possible to pick what device I want to send the command to ?

Thanks.
flomotan
Moderator
Moderator
Posts: 287
Joined: Mon Jan 08, 2007 3:37 pm

Post by flomotan »

It's currently not possible to distinguish between multiple SpaceNavigators hooked up. We will look at this and see if we can expand the API.
iklln6
Posts: 4
Joined: Thu Aug 04, 2011 8:43 am
Location: USA

distinguishing between multiple space navigators

Post by iklln6 »

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
openstyle
Posts: 1
Joined: Fri Oct 12, 2012 9:12 pm
Contact:

Re:

Post by openstyle »

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
Post Reply