Trap all button output

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

Moderator: Moderators

Post Reply
codenotes
Posts: 6
Joined: Sun Mar 08, 2015 2:10 pm

Trap all button output

Post by codenotes » Tue Mar 10, 2015 7:09 am

Is there a method to intercept all button presses and prevent them from reaching the foreground application regardless of what the configuration file for that application says? There is a definitive use-case as to why we need this.

In our use case, the space pilot is dedicated to controlling a physical robot, and not to servicing windows applications (it is communicating movements and button clicks at a very low level to the robotic hardware). However, the operator may be visiting any number of windows applications while controlling the robot, and these have nothing to do with robotic control. Again, the spacepilot is dedicated to the hardware and not the application that is running. We have a daemon that is running that currently "Grab"s the mouse and button clicks regardless of where they happen. This is good and what we want and works well, however at present, button presses still execute their secondary effect (radial menus, etc.) for whatever application happens to be in foreground. We don't want this.

It is not feasible to modify the configuration file for each potential app and put in settings to ignore buttons (I know this was suggested elsewhere in the forum). What we really need is a mode to tell the driver, "ignore any application. Just send all messages/events to the daemon that is currently "grabbing" everything." Or, perhaps better yet, "regardless of what application is in the foreground, only service and send messages to Application X and only pay attention to use its configuration file. "

Is there such a possibility?

ngomes
Moderator
Moderator
Posts: 1944
Joined: Mon Nov 27, 2006 7:22 am
Contact:

Re: Trap all button output

Post by ngomes » Tue Mar 10, 2015 8:13 am

Hi codenotes,

Have a look at the SiGrabDevice() driver API. It should allow you to manage the driver "focus" from your application.

You may still need to make changes to the driver profile for your application (to ensure the buttons work as you'd expect). We can assist with that, if necessary.

codenotes
Posts: 6
Joined: Sun Mar 08, 2015 2:10 pm

Re: Trap all button output

Post by codenotes » Tue Mar 10, 2015 12:17 pm

I am using this API call presently. And I do get button clicks in my daemon application regardless as to what other application if in foreground. However, buttons are still executing radial menus, acting as an "Escape", etc. This is what I want to prevent. So do I understand correctly that I am required to have a configuration file for my daemon application where the buttons are set to be owned by that application only?

Does Grab override all other applications that might be in the foreground and force the driver to only work with the "grabbing" application?

ngomes
Moderator
Moderator
Posts: 1944
Joined: Mon Nov 27, 2006 7:22 am
Contact:

Re: Trap all button output

Post by ngomes » Tue Mar 10, 2015 12:30 pm

codenotes wrote:buttons are still executing radial menus, acting as an "Escape", etc. This is what I want to prevent. So do I understand correctly that I am required to have a configuration file for my daemon application where the buttons are set to be owned by that application only?
Launch your application and make sure it works with the 3D mouse. Then open the "3Dconnexion Properties" panel and check what is assigned to each device button. Whenever you make a change, the driver will save a "user profile" file in %APPDATA%\3Dconnexion\3DxWare.
Make all the changes that you think are necessary and then send me the file to the API Support team (contacts are the "Software Developer" page on 3Dconnexion's web site). Make sure you make a reference to this topic.
codenotes wrote:Does Grab override all other applications that might be in the foreground and force the driver to only work with the "grabbing" application?
That's my expectation. Calling SiGrabDevice() should have the driver changes its "focus" to only the application that last called that method. Note that if you have more than one application making calls to the API, only the last call will be honoured.

codenotes
Posts: 6
Joined: Sun Mar 08, 2015 2:10 pm

Re: Trap all button output (button hold)

Post by codenotes » Sat Jun 13, 2015 5:34 am

Since upgrading to 10.2 version of drivers, I noticed that the "SiGrabDevice" is no longer grabbing all the button events automatically. Specifically, I seem to need to assign the buttons manually using the GUI tool to my application...and while this will work for a quick press and release, if you hold the button for any period of time, you get a 3dx radial menu.

This is an issue as I had been using the "hold-down" feature of the button in our applications. I can't have it bringing up a radial menu. My application is a daemon that doesn't have a visible UI nor should ever produce one. How can I transfer all events to that daemon and only that daemon as used to be the case?

jwick
Moderator
Moderator
Posts: 2534
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Trap all button output

Post by jwick » Mon Jun 15, 2015 7:45 am

To turn off the long press buttons add an entry in your %appdata%\3dconnexion\3dxware\Cfg\Global.xml file.

Code: Select all

<Global Default="false" xmlns="">
  <Settings>
	<OnScreenDisplayEnabled>false</OnScreenDisplayEnabled>
  </Settings>
...
</Global>
This is only for devices in which the long press buttons can be disabled. E.g., SpaceMouse Pro (wired and wireless). Not the SpacePilot Pro.

Post Reply