Options for KB_Keystroke

Questions and answers about 3Dconnexion devices on Windows.

Moderator: Moderators

Post Reply
scubanarc
Posts: 4
Joined: Sun Jun 20, 2021 4:08 pm

Options for KB_Keystroke

Post by scubanarc »

@jwick

I've been editing the XML config files based on the examples in the "C:\Program Files\3Dconnexion\3DxWare\3DxWinCore\Cfg" directory and having some success, but it's a lot of trial and error. I'm looking for a list of options to use when binding HIDMultiAxis --> KB_Keystroke.

I've figured out that Key 04 = a, 05 = b, ... What about other keys? What are the numbers for left, right, up, down, pgup, pgdn, esc, enter, space?

Other than RepeatAndHold, what are the available RepeatStyles?

In the KeyStroke section, is it possible to have a Modifier, like Ctrl/Alt/Shift?

Can you bind a Macro instead of a KeyStroke? If so, then how?

Thanks for any input you can provide.
jwick
Moderator
Moderator
Posts: 3339
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Options for KB_Keystroke

Post by jwick »

scubanarc wrote: Sun Jan 02, 2022 9:49 am I've figured out that Key 04 = a, 05 = b, ... What about other keys? What are the numbers for left, right, up, down, pgup, pgdn, esc, enter, space?
These values are HID codes. You can look them up online, in the HID Usage Tables, but it is far easier to just use our GUI to record a Keyboard macro for a button. The correct value for that key will be written into the cfg file for whatever application is in focus (under %appdata%). They are locale-specific, so they depend to some extent on what language your system / keyboard is in.
scubanarc wrote: Sun Jan 02, 2022 9:49 am Other than RepeatAndHold, what are the available RepeatStyles?
The two options are PressAndHold and Auto. Where PressAndHold holds down the button while the AxisAction is in effect (likely invoking key auto-repeat). Auto quickly presses and releases the key repeatedly depending on how hard you are pushing on that axis (PWM).
scubanarc wrote: Sun Jan 02, 2022 9:49 am In the KeyStroke section, is it possible to have a Modifier, like Ctrl/Alt/Shift?
Yes, you can have a <Modifiers> element. IIRC, there may be some limitations, e.g., only one modifier key. E.g., Ctrl+UpArrow but not Ctrl+Shift+UpArrow. I'd have to have another look.
scubanarc wrote: Sun Jan 02, 2022 9:49 am Can you bind a Macro instead of a KeyStroke? If so, then how?
I don't think you can do a Macro on an Axis ATM. Just single keystrokes with modifiers. But you can extend the capabilities if you want to write some code.
scubanarc
Posts: 4
Joined: Sun Jun 20, 2021 4:08 pm

Re: Options for KB_Keystroke

Post by scubanarc »

Excellent answers all around, thank you very much.
jwick wrote: Mon Jan 03, 2022 1:36 am Yes, you can have a <Modifiers> element. IIRC, there may be some limitations, e.g., only one modifier key. E.g., Ctrl+UpArrow but not Ctrl+Shift+UpArrow. I'd have to have another look.
I can't seem to get modifiers to work. I can send keystrokes just fine, but the modifier isn't getting held down.

As a test I tried to send "Ctrl+P" to notepad, which should invoke the print dialog. Here's a snippet:

Code: Select all

      <Axis>
        <Enabled>true</Enabled>
        <Input>
          <ActionID>HIDMultiAxis_X</ActionID>
          <Min>-512</Min>
          <Max>0</Max>
          <Deadband>200</Deadband>
        </Input>
        <Output>
          <ActionID>KB_Keystroke</ActionID>
          <RepeatStyle>Auto</RepeatStyle>
          <MaxEventRate>50.00</MaxEventRate>
          <KeyStroke>
            <Modifiers>
                <Modifier>Control</Modifier>
            </Modifiers>
            <Key>13</Key>
           </KeyStroke>
        </Output>
      </Axis>
The 'p' get's sent, but not the Ctrl. Any ideas?
jwick wrote: Mon Jan 03, 2022 1:36 am
scubanarc wrote: Sun Jan 02, 2022 9:49 am Can you bind a Macro instead of a KeyStroke? If so, then how?
I don't think you can do a Macro on an Axis ATM. Just single keystrokes with modifiers. But you can extend the capabilities if you want to write some code.
Please show me how. I'm a programmer by trade, and I would love to pull some more functionality out of this device.
jwick
Moderator
Moderator
Posts: 3339
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Options for KB_Keystroke

Post by jwick »

The Modifiers element is in the wrong place. See this thread.

I thought there was a thread explaining how to use the extension mechanism. I can't find it. Send me a PM if you want some samples.
Essentially you can define a ButtonAction or AxisAction that will call a DLL, exe, script, whatnot when a button or axis is actuated, instead of having the driver handle this action its own way. These Actions can have their own names, icons, etc. like any other prefab'ed Action.
scubanarc
Posts: 4
Joined: Sun Jun 20, 2021 4:08 pm

Re: Options for KB_Keystroke

Post by scubanarc »

jwick wrote: Mon Jan 10, 2022 4:23 am The Modifiers element is in the wrong place. See this thread.
Got it, that worked. Thanks.
jwick wrote: Mon Jan 10, 2022 4:23 am I thought there was a thread explaining how to use the extension mechanism. I can't find it. Send me a PM if you want some samples.
I do! That sounds like exactly what I'm looking for.

I tried to use the forum's PM feature but it won't let me. Can you send them any other way? My email address on this forum is accurate.
jwick
Moderator
Moderator
Posts: 3339
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Options for KB_Keystroke

Post by jwick »

Email sent
Post Reply