Joystick tips & tricks

This took me some time to find out, and it could be useful (A06):

If you install the xserver-xorg-input-joystick package (and restart X11 or reboot), the DevTerm’s joystick (the directional keys in the upper left & right corners) will emulate a mouse. Moving the mouse with the joystick directional keys is great, you can swing from left to right in an instant; less so for precise movement, but that’s what the trackball is for. The ABXY keys simulate different mouse buttons, which is less useful. But you can remap the actions to something else.

So far so good, but if you launch an application that has native support for a joystick, then you will get mouse movements and clicks in addition to the joystick events - not optimal.

To fix the issue, install xinput and then the command xinput set-prop pointer:'ClockworkPI DevTerm' 'Generate Mouse Events' 0 stops the mouse emulation, while your joystick still works. Replace 0 with 1 to re-enable the emulation (i.e. create a wrapper around the application that needs the joystick to disable and then enable mouse emulation).

4 Likes

Curious what apps you might be using!

In my case, fuse-gtk, or fuse-sdl :slight_smile: - both have additional issues I am now fighting with though, but unrelated to the joystick.

Thanks for this tip! it’s really helped me out! I mostly just play retro games on my DT, but every now and then it’s called into service to help me map a network or something for a client, and when I do, fiddling around with that tiny trackball is a pain! I’ve set this up as default with a quick script to easily turn it off, which I suppose now I should map to a shortcut! Awesome tip! Thank you, again!

EDIT: I did exactly that, in case anyone is interested. I mapped this script to the right ALT key as I rarely use it via keyboard shortcuts.

#!/bin/bash

# Simple script to enable/disable Joystick mouse emulation on the Devterm. Requires xinput an xserver-xorg-input-joystick to be installed
#(i.e. apt install xserver-xorg-input-joystick xinput)

TOGGLE=$HOME/.toggle

if [ ! -e $TOGGLE ]; then
    touch $TOGGLE
    xinput set-prop pointer:'ClockworkPI DevTerm' 'Generate Mouse Events' 1
else
    rm $TOGGLE
    xinput set-prop pointer:'ClockworkPI DevTerm' 'Generate Mouse Events' 0
fi