A question about the WindowCaption element, for use in XML files

Questions and answers about 3Dconnexion devices on Windows.

Moderator: Moderators

Post Reply
Framed_Previz90
Posts: 37
Joined: Sat May 23, 2020 8:31 pm

A question about the WindowCaption element, for use in XML files

Post by Framed_Previz90 »

So I have been reading the forum allot and have found answers to a few questions that I had.

I have one question that I have not been able to find a conclusive answer to.

When working with a given application, I am looking for a way to limit the 3D aware capabilities of the puck to only work if a certain window of the application is active. If other windows of the same application are active, the puck should always fire keyboard keys.

Lets for example say the application in question is Autodesk Maya, therefore the 3D navigation capabilities of the puck should only work if the main window of Maya is active, which has the substring - Autodesk MAYA 2023 somewhere in the windows caption.

Through reading THIS thread and this one HERE I discovered the <WindowCaption> element and I was able to build a working example of the 3D navigation capabilities only working when the main maya window is active. When the Script Editor window is active, the puck triggers keyboard keys. I achieved this through 2 XML files.

Maya.xml:

Code: Select all

  <AppInfo>
    <Signature>
      <Name>STR_MAYA</Name>
    </Signature>
    <Options />
  </AppInfo>
  <CfgProperties>
    <ID>ID_STR_MAYA</ID>
    <Name>STR_MAYA</Name>
    <InheritsFromID>ID_STR_MAYA</InheritsFromID>
  </CfgProperties>
  <Devices>
    <Device>
and Script Editor.xml:

Code: Select all

  <AppInfo>
    <Signature>
       <ExecutableName>maya.exe</ExecutableName>
      <WindowCaption SubStringLocation="AnyWhere">Script Editor</WindowCaption>
    </Signature>
    <Options />
  </AppInfo>
  <CfgProperties>
    <ID>ID_STR_MAYA</ID>
    <Name>STR_MAYA</Name>
    <InheritsFromID>ID_STR_MAYA</InheritsFromID>
  </CfgProperties>
  <Devices>
The problem I have is that for every window that I want the puck to fire keyboard keys instead of navigating in 3D I have to create a new .xml file just for that window, going through the process over again.
This is daunting, as there are allot of windows in Maya, furthermore I wish to implement this idea into many other 3DX aware software's that I use.

Also, I am assigning the same keyboard keys to all the axis, so no matter what window is active, the same set of keyboard keys are always being fired, This is true even across applications.

So the question I have is, for example in Maya, is it possible to get the puck to only perform 3D navigation if a window with the substring - Autodesk MAYA 2023 is active, otherwise, always fire keyboard keys?

This way, I need to only define two .xml files:
  • Maya.xml
  • Maya Editors.xml

Then, to implement this idea into other software's that supports 3DX devices, I would only need two Xml files: ThisSoftware.xml and ThisSoftware Editors.xml

Any help into finalising the long held dream of mine, would be greatly appreciated!
jwick
Moderator
Moderator
Posts: 3456
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: A question about the WindowCaption element, for use in XML files

Post by jwick »

That is an interesting idea.

You would have two cfg files that use <ExecutableName>Maya.exe
You would qualify the "3Dmouse" cfg (the one we ship) with the WindowCaption, and the other one having no further qualifiers, would get used for all windows that do not have the matching caption.

I'd be impressed if that works. For one, it is going to rely on the driver looking for a new cfg each time you slide the cursor over a new window/viewport.

You will want to keep on eye on the %localappdata%\3Dconnexion\3DxWare\3DxService.log file to see what it is doing. There are an overwhelming number of messages in there unrelated to cfg determination. If you look at the beginning of every line (the hex number), it will give you the mask of those types of messages. You can change the LogLevel mask value to mask out all but the messages you are interested in. Pretty geeky I know...there used to be a GUI to do that...now you have to do it on your own. You might want something like 00000408.

Another option comes to mind. If you can spare a button on your device, you can use one button to toggle back and forth, globally, between a cfg that does your macros, and the 3D mouse cfg for whatever application you are using. You could even do that automatically if you wanted to write some code.
Framed_Previz90
Posts: 37
Joined: Sat May 23, 2020 8:31 pm

Re: A question about the WindowCaption element, for use in XML files

Post by Framed_Previz90 »

Hey thanks allot for your input.
jwick wrote: Sun Apr 16, 2023 11:28 pm You will want to keep on eye on the %localappdata%\3Dconnexion\3DxWare\3DxService.log file to see what it is doing. There are an overwhelming number of messages in there unrelated to cfg determination. If you look at the beginning of every line (the hex number), it will give you the mask of those types of messages. You can change the LogLevel mask value to mask out all but the messages you are interested in. Pretty geeky I know...there used to be a GUI to do that...now you have to do it on your own. You might want something like 00000408.
This sounds very interesting, thank you so much for sharing this.
>Another option comes to mind. If you can spare a button on your device, you can use one button to toggle back and forth, globally, between a cfg that does your macros, and the 3D mouse cfg for whatever application you are using. You could even do that automatically if you wanted to write some code.
I really wish to avoid this situation, not that I dont have buttons to spare, just that I really would prefer the automatic method. I can write code but only in PowerShell and AutoHotkey, I am fairly advanced in them.

What kind of code do you have in mind though?
jwick
Moderator
Moderator
Posts: 3456
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: A question about the WindowCaption element, for use in XML files

Post by jwick »

Framed_Previz90 wrote: Wed Apr 19, 2023 10:29 am What kind of code do you have in mind though?
It would need to be something that would run all the time, in the background, watch the cursor position and change the XML file. Now that I think about it, it is fairly impractical for you to do that, especially with one of those languages. Forget I mentioned it. Hopefully your approach of culling out the WindowCaption will work.
Framed_Previz90
Posts: 37
Joined: Sat May 23, 2020 8:31 pm

Re: A question about the WindowCaption element, for use in XML files

Post by Framed_Previz90 »

jwick wrote: Thu Apr 20, 2023 12:51 am
Framed_Previz90 wrote: Wed Apr 19, 2023 10:29 am What kind of code do you have in mind though?
It would need to be something that would run all the time, in the background, watch the cursor position and change the XML file. Now that I think about it, it is fairly impractical for you to do that, especially with one of those languages. Forget I mentioned it. Hopefully your approach of culling out the WindowCaption will work.
Ahh I see, no worries.

I have been using it for a few days and I am fairly happy with what I have, surprised I came this far. Thanks allot Jwick.
Post Reply