Space mouse. Assigning X/Y axis to keyborad arrows

Questions and answers about 3Dconnexion devices on Windows.

Moderator: Moderators

AlexGalland
Posts: 10
Joined: Thu May 20, 2021 7:35 am

Space mouse. Assigning X/Y axis to keyborad arrows

Post by AlexGalland »

Dear community,

In order to use my space mouse for digital pathology purpose, i would need to assign the X/Y joystick axis to keyboard arrows. I managed to activate it as mouse X/Y but it is not efficient. Best option would be to assign arrows (like maintaining push the arrow)
Would that be possible?

Also, i would need to put the Z axis (clock and anticlock) to act as the mouse wheel to zoom in/zoom out. Would this also be possible?

Many thanks for your feedback.

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

Re: Space mouse. Assigning X/Y axis to keyborad arrows

Post by jwick »

Interesting. We've been getting an increase in requests for use in digital pathology. Are you using a browser to view the data?
See another thread

If you managed to get it to output mouse x/y, you must have edited a cfg file.
You can specify keyboard characters as output.
There are example files you can copy from in our installation directory (typically %programfiles%/3dconnexion/3dxware/3dxwincore/cfg).
E.g., look in KeyboardTemplate.xml for lines like:

Code: Select all

        <Axis>
          <Enabled>true</Enabled>
          <Input>
            <ActionID>HIDMultiAxis_X</ActionID>
            <Min>0</Min>
            <Max>511</Max>
            <Deadband>100</Deadband>
          </Input>
          <Output>
            <ActionID>KB_Keystroke</ActionID>
            <RepeatStyle>PressAndHold</RepeatStyle>
            <KeyStroke>
              <Key>4F</Key>
            </KeyStroke>
          </Output>
        </Axis>
This maps the device's right side X axis (0,511) to the right arrow key (4F).
AlexGalland
Posts: 10
Joined: Thu May 20, 2021 7:35 am

Re: Space mouse. Assigning X/Y axis to keyborad arrows

Post by AlexGalland »

Dear jwick

Many thanks, works perfectly for the 4 X/Y direction now.
I am using web application from Leica Biosystems company : Aperio eSlide Manager
I would also need to zoom in and out on my image. I was image using the joystick and turn it CW to zoom in and CCW to zoom out. Option offer by the Aperio viewer is to use wheel mouse to do so or use Control - and Control + keyboard entry to do it.

Do you think it could then be possible to associate one of this 2 zoom in/out option to the joystick?

Many thanks for your support.

Alex
AlexGalland
Posts: 10
Joined: Thu May 20, 2021 7:35 am

Re: Space mouse. Assigning X/Y axis to keyborad arrows

Post by AlexGalland »

Dear jwick

Many thanks, works perfectly for the 4 X/Y direction now.
I am using web application from Leica Biosystems company : Aperio eSlide Manager
I would also need to zoom in and out on my image. I was image using the joystick and turn it CW to zoom in and CCW to zoom out. Option offer by the Aperio viewer is to use wheel mouse to do so or use Control - and Control + keyboard entry to do it.

Do you think it could then be possible to associate one of this 2 zoom in/out option to the joystick?

Many thanks for your support.

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

Re: Space mouse. Assigning X/Y axis to keyborad arrows

Post by jwick »

Hi Alex,

You can assign the HIDMultiAxis_Rz to output HIDMouse_Wheel. The full axis. No reason to break it in half.

Jim
AlexGalland
Posts: 10
Joined: Thu May 20, 2021 7:35 am

Re: Space mouse. Assigning X/Y axis to keyborad arrows

Post by AlexGalland »

Hello Jim,

Many thanks for this feedback. Much appreciated.
i will try this soon.
One last question, regarding the previous one, one better way to move into the image would to add Shift button with arrow. I tried the following but it did not seems to take the Shift button in account :

<Enabled>true</Enabled>
<Input>
<ActionID>HIDMultiAxis_X</ActionID>
<Min>0</Min>
<Max>511</Max>
<Deadband>100</Deadband>
</Input>
<Output>
<ActionID>KB_Keystroke</ActionID>
<RepeatStyle>PressAndHold</RepeatStyle>
<KeyStroke>
<Key>Shift+4F</Key>
</KeyStroke>
</Output>
</Axis>

Could you give me a tips here? Should i create a macro and assign it to the axis?

Many thanks again for your great support.

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

Re: Space mouse. Assigning X/Y axis to keyborad arrows

Post by jwick »

Hi Alex,

I believe the syntax for that is:

Code: Select all

            <Modifiers>
              <Modifier>Shift</Modifier>
            </Modifiers>
            <KeyStroke>
              <Key>4F</Key>
            </KeyStroke>
AlexGalland
Posts: 10
Joined: Thu May 20, 2021 7:35 am

Re: Space mouse. Assigning X/Y axis to keyborad arrows

Post by AlexGalland »

Hi Jim,

Unfortunalty it does not change and apply the Shift :

<Axis>
<Enabled>true</Enabled>
<Input>
<ActionID>HIDMultiAxis_X</ActionID>
<Min>0</Min>
<Max>511</Max>
<Deadband>100</Deadband>
</Input>
<Output>
<ActionID>KB_Keystroke</ActionID>
<RepeatStyle>PressAndHold</RepeatStyle>
<Modifiers>
<Modifier>Shift</Modifier>
</Modifiers>
<KeyStroke>
<Key>Shift+4F</Key>
</KeyStroke>
</Output>
</Axis>
<Axis>

Did i apply it not correctly? Do you see any thing else i can try?

Many thanks again.
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Space mouse. Assigning X/Y axis to keyborad arrows

Post by jwick »

<Key>Shift+4F</Key>
is invalid. It should be
<Key>4F</Key>
AlexGalland
Posts: 10
Joined: Thu May 20, 2021 7:35 am

Re: Space mouse. Assigning X/Y axis to keyborad arrows

Post by AlexGalland »

Hello Jim,

My Bad. I correct it and still not applying shift :

<Axis>
<Enabled>true</Enabled>
<Input>
<ActionID>HIDMultiAxis_X</ActionID>
<Min>0</Min>
<Max>511</Max>
<Deadband>100</Deadband>
</Input>
<Output>
<ActionID>KB_Keystroke</ActionID>
<RepeatStyle>PressAndHold</RepeatStyle>
<Modifiers>
<Modifier>Shift</Modifier>
</Modifiers>
<KeyStroke>
<Key>4F</Key>
</KeyStroke>
</Output>

Any other option?
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Space mouse. Assigning X/Y axis to keyborad arrows

Post by jwick »

Could you PM your entire file to me?
AlexGalland
Posts: 10
Joined: Thu May 20, 2021 7:35 am

Re: Space mouse. Assigning X/Y axis to keyborad arrows

Post by AlexGalland »

Hello Jim,

Just done.

Many thanks.
jwick
Moderator
Moderator
Posts: 3331
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Space mouse. Assigning X/Y axis to keyborad arrows

Post by jwick »

Reply sent.
AlexGalland
Posts: 10
Joined: Thu May 20, 2021 7:35 am

Re: Space mouse. Assigning X/Y axis to keyborad arrows

Post by AlexGalland »

I have sent you a link in PM.

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

Re: Space mouse. Assigning X/Y axis to keyborad arrows

Post by jwick »

<Continuing here so others can read it>

I only opened two slides, but I can zoom and pan. It seems that Shift+arrows moves in larger increments than just arrows. If anything I'd like to slow it down (you can control the event rate and lower the deadband). I like it a little better w/o Shift.

Do you get no movement?

The 2D mouse is more useful IMO, until you reach the edge of the screen. Not having to ratchet is a big benefit of the 3D mouse.
The experimental code I did for a path lab in the UK seems to work better. Though it has a bug I need to address that causes unwanted zooming.

The best solution is to get the Aperio Viewer to support the 3D mouse.
Post Reply