Rpi Joystick Talk

Hey all,
I have been helping setup another machine with Rpi4 and Joystick to match mine.

I use a wired Xbox360 controller to emulate a mouse and CM jog controller. The unused CM controls are mapped for mouse emulation and other controls
FYI I also set up a really cheap ($19.00can) overseas wired Xbox360 and I sent it back. Very poor joystick controls. I then bought a ($24.00can) Logitech F310 which works very nice. Spend a bit more and get a good controller :slight_smile:

I thought someone else might be interested in how I set this up. I hope I remember all the steps. :slight_smile:

Raspberry Pi Desktop setup; Install these aps:
xserver-xorg-input-joystick ( X.org joystick driver module )
joystick ( A set of cmdline tools and tests for joystick)
joystick (Graphical joystick tester, calibrator, re-mapper) (use this to calibrate and figure out the button numbering )

Then we make a config file “51-joystick.conf” and put it in directory “/etc/X11/xorg.conf.d”, It is read by the desktop environment when it starts. Logout /Restart
This is where we setup the parameters and mapping of the joystick.
This is the file I am currently using 51-joystick.zip (622 Bytes)

Note if you are mapping the keyboard, finding the scan code can be a little tricky as they are X,org scan codes (keysym) not keyboard scan codes. I use “xmodmap -pk” to print out the mapping table on the screen.
IE x.org “space bar” scan code = 65 = 20 in ascii = 57 in keyboard scan code.
For jog speed, “key 10” = 1, “key 11” = 2, “key 12” = 3, “key 13” = 4.
You might also slow down the click rate in the desktop mouse setup, as the joystick can not double click as fast as the mouse.

I run the entire machine with just the game controller when carving. I still have a disposable wireless mouse. The mouse is still a better mouse then a joystick. but when carving I don’t have to switch back and forth. I also have a mini wireless keyboard in the draw :slight_smile: The two joysticks have different gain so you can use one or the other or both or hold the back button down to drop the mouse speed in half

There is one CM glitch that requires the real mouse.
@robgrz On occasion, I believe right after opening the app, the joystick can not continuously jog and it will not accept a 1,2,3,4 keymap unless you use the mouse first and then it works fine after that. It needs one kick :slight_smile:

I love my Rpi setup. It is perfect for my environment as I don’t want to use a laptop or computer fan, keyboard or mouse in my dusty shop environment.

Hope you find this interesting.

11 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.