Cannot send modifier key from axis output

Questions and answers about 3Dconnexion devices on Windows.

Moderator: Moderators

Post Reply
giorgio_72
Posts: 3
Joined: Tue Nov 23, 2021 10:38 am

Cannot send modifier key from axis output

Post by giorgio_72 »

I'm trying to pan the Inkscape canvas from a SpaceMouse Compact.

For the left pan, I use the following snippet:

Code: Select all

        <!-- Pan left -->
        <Axis>
          <Enabled>true</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_X</ActionID>
            <!-- move the cap left along the x-axis -->
            <Min>-512</Min>
            <Max>0</Max>
          </Input>
          <Output>
            <ActionID>KB_Keystroke</ActionID>
            <KeyStroke>
              <Modifiers>
                <Modifier>Control</Modifier>
              </Modifiers>
              <Key>50</Key> <!-- <LeftArrow> HID scancode -->
              <!--
                Emitted: <LeftArrow>
                Expected: <Ctrl+LeftArrow>
              -->
            </KeyStroke>
          </Output>
        </Axis>
but, instead of emitting the expected `<Ctrl+LeftArrow>` (which is the non-configurable shortcut that Inkscape expects to pan the canvas left), the driver emits `<LeftArrow>`

I thought to replace the `<Modifiers>` subtree with the `<Key>E0</Key>` element (which represents the `<LeftCtrl>` HID scancode), but in that case the driver emits `<Ctrl>` followed by `<LeftArrow>`, instead of the expected `<Ctrl+LeftArrow>`

I also thought to move the `<KeyStroke>` subtree in a macro and call the macro from the axis by specifying the macro ID in the content of `<ActionID>`, to no avail.

The driver emits `<Ctrl+LeftArrow>` only if any`<Ctrl>` keyboard key is pressed down while moving the cap along the x-axis to the left; this is sub-optimal, because I must use two hands to pan the Inkscape canvas, instead of one.

Is it me, or is the driver not able to emit `<Modifier+Key>` keycodes from axes?

Versions used:
  • 3DxWare: 10.8.3.3389
  • 3DxWinCore: 17.8.3.18895
on fully updated Windows 10 and Inkscape 1.1.1
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Cannot send modifier key from axis output

Post by jwick »

Very close. The Modifiers are on the entire event, not just the KeyStroke (that was my thinking anyway).
The correct syntax (e.g.) is:

Code: Select all

        <Axis>
          <Enabled>true</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_Ry</ActionID>
            <Min>0</Min>
            <Max>511</Max>
          </Input>
          <Output>
            <ActionID>KB_Keystroke</ActionID>
            <Scale>1.00</Scale>
            <MaxEventRate>41</MaxEventRate>
            <Modifiers>
              <Modifier>Control</Modifier>
            </Modifiers>
            <KeyStroke>
              <Key>50</Key>
            </KeyStroke>
          </Output>
        </Axis>
Without GUI support, it is very difficult to do this.
giorgio_72
Posts: 3
Joined: Tue Nov 23, 2021 10:38 am

Re: Cannot send modifier key from axis output

Post by giorgio_72 »

Thank you, it works.
Without GUI support, it is very difficult to do this.
No problem for me: IMHO, the GUI should be intended for generating simple XML configs only; any more advanced configuration should be specified by the manual text editing (i.e. hacking) of those. In this regard, the current feature set of the GUI should be more than adequate for an XML-aware user.

However, hacking the XML configs requires some knowledge of their XML schema definition: did you publish its *.xsd file somewhere?

Without it, XML-aware users have to infer (sometimes wrongly, as the first snippet shows) parts of the schema from the 3DxWinCore/Cfg/*.xml config/template files, which are partial instances of it.

And moreover, I'll have to start another topic for a similar schema-invalid XML config snippet that doesn't work as of now... stay tuned... :D
Post Reply