Assign program.exe start to button

Questions and answers about 3Dconnexion devices on Windows.

Moderator: Moderators

Post Reply
MD_Sign
Posts: 3
Joined: Thu Nov 08, 2018 2:59 am

Assign program.exe start to button

Post by MD_Sign »

Hello @all!

Short question: Is there a proper way to assign a program.exe, other than the factory default Notepad, Paint etc. to a dedicated key in one or more profiles (Desktop, Explorer_Background...)? I tried to modify the xml-Files to assign SketchUp.exe to the button where Paint "sits" in Explorer_Background.xml by copying the "Paint-Action" and changed Paint to Sketchup. I also changed the button-command to match the new ID "EXE_Start_Sketchup".

It has worked that way, but after opening the menu (i think) Paint was there again and Sketchup was gone. Is there a right way to do put Sketchup (or any other program) in the place of Paint (or on an other dedicated button) and what am I doing wrong? Where do i have to make the modifications to put Sketchup in a single profile or make it globally accessible... Would be nice to have Chrome, Sketchup, Thunderbird etc. started by pressing just a button. As I said: it has worked but was unfortunately not persistent.

Thanks for your help!

Using Space Pilot Pro on Win10 Pro with newest 3DxWare 10.5.11

Modifications I made:

<ButtonAction Type="Exe">
<ID>EXE_Start_Sketchup</ID>
<Name>Paint</Name>
<Executable>C:\Program Files\SketchUp\SketchUp 2017\SketchUp.exe</Executable>
<Arg>None</Arg>
<Image>
<Source>[driver_images:mspaint.png]</Source>
</Image>
</ButtonAction>

<Button>
<Input>
<ActionID>V3DK_8</ActionID>
</Input>
<Output>
<ActionID>EXE_Start_Sketchup</ActionID>
</Output>
</Button>
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Assign program.exe start to button

Post by jwick »

Good job!
For extra credit, you can assign the SU icon to the button.

Probably the issue is that Explorer_Background.xml is not being used very often (you can check by hovering over the 3Dx systray icon). At most it is when the machine first starts and/or if you click on the "background".

To assign it globally, which would override it everywhere, add and assign it in your global cfg (%appdata%\3Dconnexion\3DxWare\Cfg\global.xml). I often add global scaling functions to my SpaceMouse Enterprise in my global cfg.

Code: Select all

<Devices>
		<Device>
			<Name>SpaceMouse Enterprise</Name>
			<VendorID>256f</VendorID>
			<ProductID>c633</ProductID>
			<ButtonBank Default="true">
				<Name>STR_DEFAULT_BUTTONBANK</Name>
				<ID>Default</ID>
				<Button>
					<Input>
						<ActionID>HIDButton_18</ActionID>
					</Input>
					<Output>
						<ActionID>Driver_IncreaseAppScale</ActionID>
					</Output>
				</Button>
				<Button>
					<Input>
						<ActionID>HIDButton_78</ActionID>
					</Input>
					<Output>
						<ActionID>Driver_DecreaseAppScale</ActionID>
					</Output>
				</Button>
			</ButtonBank>
		</Device>
	</Devices>
MD_Sign
Posts: 3
Joined: Thu Nov 08, 2018 2:59 am

Re: Assign program.exe start to button

Post by MD_Sign »

Hello jwick,

thanks for your quick response - I´m glad not to have done completely wrong :) The SU icon (and name, which i forgot in this case) would have been the next tweaks... ;)

Basically I don´t kwow, if I made the modifications at the right place - I´ve used the XMLs that are located under C:\Program Files\3Dconnection\3DxWare\3DxWinCore64\Cfg

Why?

Because under %appdata%3Dconnexion\3DxWare\Cfg I´ve got only 6 XMLs (Chrome, Explorer_Background, Fusion360, Global, SketchUp and thunderbird) and under 3DxWinCore64\cfg there are plenty of them, including Desktop.xml, which I was assuming to be the right one, because the SpacePilot-Display shows "Desktop" if I click on the background of my desktop.

But changes here (under the Appdata CFGs) didn´t have any effect, beside that the mentioned changes in the Explorer_Background.xml just deletes Paint from the display-menu-button 8 (V3DK_8) and shows an empty space without any function.

Where is the difference between Desktop.xml and Explorer_Background.xml and which one under which path would be the right one to put the programs I´d like to trigger, when the computer has just started and/or I moseclick on an empty desktop-space? Which one overrides which one and do they have a dependency?

The global assignment would be to much for just triggering program.exes, as in this case SU would show up, even when SU has been started, right? For global accessible functions this is a clever way, but as i only work with a few programs that have comparable functions, this will probably not be the way to get my "startpad"-idea running.

Thanks again for your help - hope my writing is not too confusing... :oops:

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

Re: Assign program.exe start to button

Post by jwick »

PM your file to me and I'll have a look.

Another possibility is to add your application launches to a Radial Menu so you don't use up so many SME buttons.
Or to press a button on the SME to bring up a temporary set of buttons with your app launches on it.
I'll have to help you with those because the GUI doesn't support it.

The default files we ship are in Program Files. When you make changes in our GUI, only your changes are stored in %appdata%. %appdata% files overwrite the values in the PF files. It should be possible to put these in either place. But if you change PF, it will get lost next time you update your 3DxWare. AD is the best place to make your changes.

Hover over the 3Dx systray icon to see which file is being used at any given time.
MD_Sign
Posts: 3
Joined: Thu Nov 08, 2018 2:59 am

Re: Assign program.exe start to button

Post by MD_Sign »

Hello jwick,

it seems that I was to impatient - now you´ve got my answer twice, second time with a happy update and picture :)

Now I think I do also understand the dependency of the xml-files: the ones in PF are the "base-files" with the common used functions and the AD files are only the modifications made by GUI. If I modify the AD XML by hand, the changed values override and supplement the data in the PF XML.

For the possible update-issue I´ll reset the PF files to default - glad I did a copy of each :)

And now I´ve also learned that PF XML must not be newer than AD XML, otherwise the "custom" tweaks won´t override the basic informations. My heart stopped two beats right before I figured that out... :D

"Or to press a button on the SME to bring up a temporary set of buttons with your app launches on it." - now that sounds VERY interesting. Pushing FIT in Desktop-Mode to launch an "App-Launcer" would be the icing on the cake! Hope this will work also on SpacePilot Pro and not only on SME. I´ll send you my AD Explorer_Background.xml via PM - if you can create this kind of FIT-button-press App-Launcer, I´ll be a very happy camper!

Sorry for my initial impatience and thanks a lot for your great help!

Regards,
Maik
jeffg28CLY
Posts: 3
Joined: Thu Jan 09, 2020 8:58 am

Re: Assign program.exe start to button

Post by jeffg28CLY »

jwick,
Bumping an old thread... with a question:

Is there a document detailing the expected structure of the XML file?

I'm also trying to tie an EXE file to one of the 12 programmable buttons, to be available globally, so I'm working inside the global.xml file. So far I was able to duplicate your Driver_IncreaseAppScale example, but when I try MD_Sign's code, all I'm able to get the Spacemouse to do is show blank on the onboard screen for that assigned button. So something isn't formatted or arranged correctly, but I'm not sure what. Admittedly I'm out of practice as far as programming is concerned.

There are various tags or headers, like <Executable> and <ActionID> and <ID> and <Style>, but I'm not sure what they do or how they're expected to be used, or which ones are necessary vs optional.
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Assign program.exe start to button

Post by jwick »

Hello jeffg28CLY,

There is a schema. It will probably be distributed in a future release. But that is just syntax; it doesn't tell you the intent (how really to use it). ATM you have me for that.

To run an arbitrary Exe, you have to tell the driver where it is (make a ButtonAction defining it).
You have to do this manually. But you can use the template at the top of this posting (EXE_Start_Sketchup).

Then tell the driver which button you want to execute that new ButtonAction.

You can use the GUI for some of this. It won't edit Global.xml. It will edit some other file (e.g., explorer.xml), but you can copy those changes to Global.xml. The entries are the same for the Device in one file or another.

A future version of the driver will do some of this for you.
I can help you with the editing if you identify the executables.
jeffg28CLY
Posts: 3
Joined: Thu Jan 09, 2020 8:58 am

Re: Assign program.exe start to button

Post by jeffg28CLY »

Ok, I'll have to see when I can work at this again.

Will there be provision added at some point to run an EXE without doing this XML editing?

So for example, in the screen to define Buttons, the drop-down gives <Program name>, Keyboard, Macros, Mouse, Radial Menus.
I'd like to be able to assign some buttons for things like maybe opening a Notepad window, or Calculator, or a browser window. There are a few existing programs in the Macros section, like File Manager (handy) and Task Manager.


Overall though, I'm loving this thing. I was able to get the Enterprise. It's good stuff.
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Assign program.exe start to button

Post by jwick »

I'd wait for the next release before wasting too much time editing XML files.
Phil999
Posts: 425
Joined: Tue Jun 30, 2009 5:20 am

Re: Assign program.exe start to button

Post by Phil999 »

oh, this sounds promising.
Space Navigator x2, Space Pilot, Space Pilot Pro, SpaceMouse Enterprise
rstadie
Moderator
Moderator
Posts: 777
Joined: Tue Sep 25, 2007 6:18 am
Location: Munich, Germany
Contact:

Re: Assign program.exe start to button

Post by rstadie »

Hi,

Did you already try the latest driver version?
Robert Stadie
Post Reply