SpaceNavigator - Keyboard simulator

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

Moderator: Moderators

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

Re: SpaceNavigator - Keyboard simulator

Post by jwick »

The cfg file format has changed slightly. It has a new CfgFormatVersion (1.3). If you overrode the new file with a 1.2 file in the Program Files dir it's probably being rejected (the log file will say). A proper Desktop.xml is critical to the operation of the driver (at least the startup).

Start with the new file and re-add the Axis elements. Start by making some change to the device in the GUI so you get a starting point for the new device.

It is better to make changes in dirs where the driver expects changes. It assumes it has control over the files it delivers.
If you make those changes in the user dir (%appdata%) the driver will [try to] upgrade the files when a new CfgFormatVersion comes along. It can't do anything with files in Program Files because it doesn't have permissions to change them.
mmjc23
Posts: 15
Joined: Wed Dec 07, 2016 8:36 am

Re: SpaceNavigator - Keyboard simulator

Post by mmjc23 »

Hi jwick
... and thanks for the reply.
I modified the "Explorer.xml" file in% appdata% directory and now it seems to work correctly.
I assume that the new CfgFormatVersion depends on the version of the Drivers and not on the device; it's correct?
Compared to the 3dx-600028 device and the old drivers, it seems that the response to the commands is much slower. I'll do some tests.

With Windows 10, I have another problem.
It seems that if the application does not respond within the maximum time "LowLevelHooksTimeout" set in the system registry, the application loses the keyboard keys management (SetWindowsHookEx Windows API).
Even if the "LowLevelHooksTimeout" time is increased to 10 seconds, the application often loses management.
Could I finally solve the problem by implementing the 3dxConnexion SDK in my application?

Thanks so much
Best Regards
jwick
Moderator
Moderator
Posts: 3330
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: SpaceNavigator - Keyboard simulator

Post by jwick »

Yes, the CfgFormatVersion is tied to a driver (3DxWinCore) release.

You can only go forward with upgrades. If you go backwards over a CfgFormatVersion change, none of your files will work. They will have all been upgraded to the new version. I don't keep the old versions and I don't try to back-convert. If you think you want to go back to a previous version, you need to save your old cfgs somewhere before installing the new driver. I can help restore your old versions if you need them. The syntax tends to only changes toward the top of the file, where it identifies the cfg or the app. The Device-specific entries have been stable. I'm thinking of splitting those two sections to avoid these issues.

The next driver release is more informative about handling cfg problems.

There should not be much of a difference between devices from model to model. The cap is always the same. The only time you might see differences in response is a) a cfg that has been changed for one device but not the other, b) a wireless device that is seeing a lot of over-the-air interference.

I don't know anything about LowLevelHooksTimeout. The KMJ keyboard should behave exactly like the physical keyboard. Events are sent to the system. What happens after that is up to the system. A 10s wait to get an event does seem awfully long, especially from a user's point of view.

Things with the 3D mouse are always better using our SDK. Motion is smoother, and we take care to expose new device functionality as it appears. It generally allows your application to support new 3D mice w/o requiring changes. Like any software, it also has its limitations.
mmjc23
Posts: 15
Joined: Wed Dec 07, 2016 8:36 am

Re: SpaceNavigator - Keyboard simulator

Post by mmjc23 »

Thanks for the answers and for the advice, jwick
I will try to take a look at the SDK.

About directories ...
I prefer to edit the XML files in the "Program Files" directory so that the configuration is used by all Windows users.
It should also prevent the user from changing the configuration using the 3DxWinCore utility in the traybar.

Are ALL the XML files read/loaded at drivers startup or only the xml file according to the application in use is read?
If an XML file contains the Default = "true" and <Grab> Hard </Grab> instructions, will the configuration of that XML file always be used for all applications? Is it then possible to delete other XML files?
Which XML file is best modified to force the device to use my configuration at startup (desktop.xml, explorer.xml, etc.)?

Thank you in advance
Best Regards
jwick
Moderator
Moderator
Posts: 3330
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: SpaceNavigator - Keyboard simulator

Post by jwick »

If you edit the files in Program Files, our installer will overwrite them.

If you want to overwrite default files in Program Files, it is better to put them into a directory you normally have access to and the driver will respect:
%programdata%/3Dconnexion/3DxWare/cfg.

The driver will look there for default files before it looks in %ProgramFiles%.
All this is subject to change...and is unofficial. I'm working on a official solution.
But this is also not a perfect solution. If the CfgFormatVersion changes, then these files are invalid. But it is no different than if you changed %PF% and your changes got thrown away. At least your files on still there and can be updated. The next driver release will provide more information at the user level. There is information only in the log file now.

You don't need all the cfg files we ship. Most are app-specific and are not needed if you don't have those applications. The minimum set is: Base.xml, en-us.xml, Global.xml, Desktop.xml, AppDefCfg_*.xml, 3DxSmartUI.xml.

If you don't want users to use 3DxSmartUI, delete it.
You can also make cfgs readonly if you want users to use the GUI to see what the assignments are, but not change anything.

<Grab>Hard</Grab> will only get used if for some reason the cfg is loaded. Desktop.xml is always loaded first so a Hard Grab in there will take highest priority. A Hard Grab in another cfg will only get used if the user starts the app. At that time, that application will Grab all the input. I think Desktop/Grab/Hard would overrides that because it wouldn't switch to the other app in the first place.

I'm always looking at these specialized uses of the driver. If you have any suggestions for your particular use, please chime in. Everything would be easier if the GUI had an advanced mode to address these uncommon tasks.
mmjc23
Posts: 15
Joined: Wed Dec 07, 2016 8:36 am

Re: SpaceNavigator - Keyboard simulator

Post by mmjc23 »

Thank you very much for the explanation, jwick
jadfa
Posts: 3
Joined: Tue May 05, 2020 2:10 am

Re: SpaceNavigator - Keyboard simulator

Post by jadfa »

I know this is an old thread but seems like the "axis binding to key" feature doesn't work anymore.
Running 3DxWare 10.4.3 with SpaceExplorer, this is not OK:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<AppCfg Default="false" xmlns="" CfgFormatVersion="1.2" ThisFileVersion="1.3">
  <AppInfo>
    <Signature>
      <Name>Notepad</Name>
      <ExecutableName>notepad.exe</ExecutableName>
      <Transport>KMJ</Transport>
    </Signature>
    <Options />
  </AppInfo>
  <CfgProperties>
    <InheritsFrom>STR_DESKTOP</InheritsFrom>
  </CfgProperties>
  <MacroTable>
    <MacroEntry>
      <ID>A</ID>
      <KeyStroke>
        <Key>04</Key>
      </KeyStroke>
    </MacroEntry>
  </MacroTable>
  <Devices>
    <Device>
      <Name>SpaceExplorer</Name>
      <VendorID>46d</VendorID>
      <ProductID>c627</ProductID>
      <Axis>
        <Enabled>true</Enabled>
        <Input>
          <ActionID>HIDMultiAxis_Z</ActionID>
          <Min>0</Min>
          <Max>511</Max>
          <Deadband>508</Deadband>
        </Input>
        <Output>
          <ActionID>A</ActionID>
        </Output>
Any idea?
jwick
Moderator
Moderator
Posts: 3330
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: SpaceNavigator - Keyboard simulator

Post by jwick »

Your device is unlikely to produce a value as high as 508. Try a lower Deadband.

That syntax is not correct. Macros on axes are not supported (ATM).
Try:

Code: Select all

         <Output>
            <ActionID>KB_Keystroke</ActionID>
            <Scale>1.00</Scale>
            <MaxEventRate>40</MaxEventRate>
            <KeyStroke>
              <Key>04</Key>
            </KeyStroke>
          </Output>
          
jadfa
Posts: 3
Joined: Tue May 05, 2020 2:10 am

Re: SpaceNavigator - Keyboard simulator

Post by jadfa »

Thanks for your advice, but still doesn't work for me.
I have to investigate the log file to understand, but seems like the driver can't respect the <axis> part of the xml.
jwick
Moderator
Moderator
Posts: 3330
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: SpaceNavigator - Keyboard simulator

Post by jwick »

jadfa,

If you PM your file to me, I may be able to spot the problem.
jadfa
Posts: 3
Joined: Tue May 05, 2020 2:10 am

Re: SpaceNavigator - Keyboard simulator

Post by jadfa »

Definitely a driver problem.
When I try to bind axis to keys, driver crash and log stop without any error:

Code: Select all

00000040 9:47:59.932: AppSignature::Equals: ExeName 3DxService.exe does not equal soffice.bin
00000040 9:47:59.932: AppSignature::Equals: ExeName 3DxService.exe does not equal soffice.bin
00000040 9:47:59.932: AppSignature::Equals: ExeName 3DxService.exe does not equal soffice.bin
00000040 9:47:59.932: 3DxService.cpp:CheckForChangeMethod: App changed from 3DxService.exe/PID=9704/Focus=0x602d2/Cursor=0x602d2 to soffice.bin/PID=5672/Focus=0x170cde/Cursor=0x170cde
00000008 9:47:59.932: FocusOrParentHwndAndSI_ANY_DEVICEBestTransportAppHdl: For focusApp soffice.bin/PID=5672/Focus=0x170cde/Cursor=0x170cde
00000008 9:47:59.932: FocusOrParentHwndAndSI_ANY_DEVICEBestTransportAppHdl: FocusApp: Exe soffice.bin. Checking against AppHdl (0x00000142E3E54F20): ExeName=3DxService.exe, transport Unknown, hwnd=0x00000000000602D2, Cfg: STR_3DXSERVICE
00000008 9:47:59.932: FocusOrParentHwndAndSI_ANY_DEVICEBestTransportAppHdl: FocusApp: Exe soffice.bin. Checking against AppHdl (0x00000142E3CB6180): ExeName=
      , transport KMJ, hwnd=0x00000000000A0BA4, Cfg: STR_DESKTOP
00000400 9:47:59.948: Cfg::Cfg(soffice.bin) Filename:C:\Users\fabrice.jade\AppData\Roaming\3Dconnexion\3DxWare\Cfg\essai.xml
00000040 9:48:0.054: AppHdl(0x00000142E3E7C590)::Changed(true) for soffice.bin
00000008 9:48:0.054: CheckForNewFocusAppHdl: Made a new AppHdl 0x00000142E3E7C590 for soffice.bin using LibreOffice
00000008 9:48:0.054: AppHdlList::CheckForChange: DevAppHdlMap[Notification-Only device] set to AppHdl=0x00000142E3E7C590
00000040 9:48:0.054: AppHdl(0x00000142E3E7C590)::Changed(true) for soffice.bin
00000008 9:48:0.054: FocusHwndAndSI_ANY_DEVICEBestTransportAppHdl: soffice.bin using AppHdl 0x00000142E3E7C590 for soffice.bin with cfg: LibreOffice
00000008 9:48:0.054: AppHdlList::CheckForChange: DevAppHdlMap[SpaceExplorer] set to AppHdl=0x00000142E3E7C590
00000040 9:48:0.054: AppHdl(0x00000142E3E7C590)::Changed(true) for soffice.bin
(for info, these are the last lines of the log, whith file essai.xml on soffice.bin trying to bind like this:

Code: Select all

    <Device>
      <Name>Standard 3D Mouse</Name>
      <VendorID>0</VendorID>
      <ProductID>0</ProductID>
      <InheritsFrom>Standard 3D Mouse</InheritsFrom>
      <Axis>
        <Enabled>true</Enabled>
        <Input>
          <ActionID>HIDMultiAxis_X</ActionID>
          <Min>-512</Min>
          <Max>511</Max>
        </Input>
        <Output>
         <ActionID>KB_Keystroke</ActionID>
         <RepeatStyle>PressAndHold</RepeatStyle>
         <Reversed>false</Reversed>
         <KeyStroke><Key>04</Key></KeyStroke>
        </Output>
      </Axis>
)
Post Reply