Assign keyboard shortcuts to rotation axis

Questions and answers about 3Dconnexion devices on Windows.

Moderator: Moderators

Post Reply
desimir
Posts: 3
Joined: Tue Jan 29, 2019 2:22 am

Assign keyboard shortcuts to rotation axis

Post by desimir » Sun Feb 03, 2019 11:18 pm

I am using Clip Studio Paint with Space Pilot Pro, and I customize almost everything I need, but I had no luck assigning any keyboard shortcuts to any rotation axis. I need to assign keys [ and ] to Rz axis (I have also tried other keys), but, I have no luck. I do not have problem assigning mouse wheel actions to axis events, though. This is not something specific to Clip Studio Paint, since eg. Notepad doesn't work either. I have tried to assign Key, Keypress, Macro... using keywords for modifiers, press and hold... all combinations I could imagine and nothing seems to work. Any ideas?

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

Re: Assign keyboard shortcuts to rotation axis

Post by jwick » Mon Feb 04, 2019 1:44 am

The GUI can't help you with this, but if you can edit the cfg file for the app, here is one example of how you add two keys on an axis (positive and negative direction). I think these send A and S keys. You need to replace the <Key> values with the values for the keys you want to send. You can look them up online, but the easiest way is to create a kb macro with our GUI and see what value it saves in the cfg file.

Code: Select all

      <AxisBank Default="true">
        <Name>STR_DEFAULT_BANK</Name>
        <ID>Default</ID>
        <Axis>
          <Enabled>true</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_X</ActionID>
            <Min>0</Min>
            <Max>511</Max>
            <Deadband>200</Deadband>
          </Input>
          <Output>
            <ActionID>KB_Keystroke</ActionID>
            <RepeatStyle>PressAndHold</RepeatStyle>
            <KeyStroke>
              <Key>8</Key>
            </KeyStroke>
          </Output>
        </Axis>
        <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>PressAndHold</RepeatStyle>
            <KeyStroke>
              <Key>14</Key>
            </KeyStroke>
          </Output>
        </Axis>
      </AxisBank>

desimir
Posts: 3
Joined: Tue Jan 29, 2019 2:22 am

Re: Assign keyboard shortcuts to rotation axis

Post by desimir » Tue Feb 05, 2019 5:48 pm

Thank you! Somehow your code work like a magic, even I'm sure that I have tried exactly the same code, which doesn't work in my case! However, your code did the trick! Thank you again!

Meende
Posts: 7
Joined: Wed Apr 10, 2019 8:59 am

Re: Assign keyboard shortcuts to rotation axis

Post by Meende » Mon May 06, 2019 8:31 am

Hello, it really works. Thank U. Maybe you also know how to assign not just a key but a key combination, for example CTRL+ PAGEUP and CTRL + PAGEDOWN?
Thanks a lot

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

Re: Assign keyboard shortcuts to rotation axis

Post by jwick » Tue May 07, 2019 12:32 am

I believe this still works. For example, this adds a Control key Modifier to KeyStroke (PageDown).

Code: Select all

        <Axis>
          <Enabled>true</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_Ry</ActionID>
            <Min>-512</Min>
            <Max>0</Max>
          </Input>
          <Output>
            <ActionID>KB_Keystroke</ActionID>
            <Scale>1.00</Scale>
            <MaxEventRate>40.00</MaxEventRate>
            <Modifiers>
              <Modifier>Control</Modifier>
            </Modifiers>
            <KeyStroke>
              <Key>4e</Key>
            </KeyStroke>
          </Output>
        </Axis>
Possible Modifiers are: Control, Shift, Alt, Windows, LeftMouse, MiddleMouse, RightMouse.

You can specify more than one.

If you specify conflicting Modifiers on different axes that may be active at the same time, I do my best to deliver what you asked for. That doesn't mean the app will receive it though. Many apps, especially games, poll the keyboard. They will see whatever the state is at the moment it asks. It is best to use a filter to separate the axes in this case.

Meende
Posts: 7
Joined: Wed Apr 10, 2019 8:59 am

Re: Assign keyboard shortcuts to rotation axis

Post by Meende » Sat May 11, 2019 8:24 am

Thanks again, i tried it but did not work for me.
What i am trying to do is to assign CTRL+pageup and CTRL+pagedown to X axis movements in chrome, to switch between tabs.
Thanks

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

Re: Assign keyboard shortcuts to rotation axis

Post by jwick » Wed May 15, 2019 4:42 am

This works for me. Possibly you were not making the changes to the correct file?

I've made some refinements that might help.

1) I find it difficult to push sideways in X. I find it much easier to tilt left/right. I've assigned ctrl+PageUp ctrl+PageDn to that axis (Ry).
2) I've turned off the other axes (<AxisFilter>Dominant and all the other Axes<Enabled>false). The cross talk is very difficult to control with the hand.
3) I've specified a dead region between +/-200. You have to exceed that before anything happens.
4) I've changed the repeat rate to 1/second. It goes way too fast otherwise.

It's not perfect. For one, it may tab in the opposite direction you want. You can change that if you don't like it.
More importantly, sometimes it doesn't release the buttons, so it keeps tabbing. Tap the cap and it will stop. That sure looks like a bug, and sounds familiar.

Code: Select all

    <Device>
      <Name>Standard 3D Mouse</Name>
      <VendorID>0</VendorID>
      <ProductID>0</ProductID>
      <AxisFilter>Dominant</AxisFilter>
      <CurrentAxisBank>Default</CurrentAxisBank>
      <CurrentButtonBank>Default</CurrentButtonBank>
      <AxisBank Default="true">
        <Name>STR_DEFAULT_BANK</Name>
        <ID>Default</ID>
        <Axis>
          <Enabled>false</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_X</ActionID>
            <Min>-512</Min>
            <Max>511</Max>
          </Input>
          <Output>
            <ActionID>HIDMultiAxis_X</ActionID>
          </Output>
        </Axis>
        <Axis>
          <Enabled>false</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_Y</ActionID>
            <Min>-512</Min>
            <Max>511</Max>
          </Input>
          <Output>
            <ActionID>HIDMultiAxis_Y</ActionID>
          </Output>
        </Axis>
        <Axis>
          <Enabled>false</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_Z</ActionID>
            <Min>-512</Min>
            <Max>511</Max>
          </Input>
          <Output>
            <ActionID>HIDMultiAxis_Z</ActionID>
          </Output>
        </Axis>
        <Axis>
          <Enabled>false</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_Rx</ActionID>
            <Min>-512</Min>
            <Max>511</Max>
          </Input>
          <Output>
            <ActionID>HIDMultiAxis_Rx</ActionID>
          </Output>
        </Axis>
	<Axis>
          <Enabled>true</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_Ry</ActionID>
            <Min>-512</Min>
            <Max>-200</Max>
          </Input>
          <Output>
            <ActionID>KB_Keystroke</ActionID>
            <Scale>1.00</Scale>
            <MaxEventRate>1.00</MaxEventRate>
            <Modifiers>
              <Modifier>Control</Modifier>
            </Modifiers>
            <KeyStroke>
              <Key>4e</Key>
            </KeyStroke>
          </Output>
        </Axis>
	<Axis>
          <Enabled>true</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_Ry</ActionID>
            <Min>-199</Min>
            <Max>199</Max>
          </Input>
          <Output>
            <ActionID>HIDMultiAxis_Ry</ActionID>
          </Output>
        </Axis>
	<Axis>
          <Enabled>true</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_Ry</ActionID>
            <Min>200</Min>
            <Max>511</Max>
          </Input>
          <Output>
            <ActionID>KB_Keystroke</ActionID>
            <Scale>1.00</Scale>
            <MaxEventRate>1.00</MaxEventRate>
            <Modifiers>
              <Modifier>Control</Modifier>
            </Modifiers>
            <KeyStroke>
              <Key>4b</Key>
            </KeyStroke>
          </Output>
        </Axis>
        <Axis>
          <Enabled>false</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_Rz</ActionID>
            <Min>-512</Min>
            <Max>511</Max>
          </Input>
          <Output>
            <ActionID>HIDMultiAxis_Rz</ActionID>
          </Output>
        </Axis>
      </AxisBank>
      ...

Post Reply