Skip to main content

Gamepad Mouse on Raspbian

Use a USB gamepad as a Raspberry Pi mouse.
Raspbian supports mice out of the box, but what if you want to use a USB gamepad to move the pointer around (and click buttons) instead?
I'm currently using a Logitech Dual Action gamepad to control my Raspberry Pi running Raspbian Stretch. Here's what I did:

Install Packages

Install the following through Add/Remove Software or the command line (sudo apt install):
  • joystick - drivers and useful joystick/gamepad test programs.
  • jstest-gtk - windowed test program.
  • xserver-xorg-input-joystick - enables joystick control of windowing system
  • qjoypad - enables reconfiguration and remapping of joystick events.
This should automatically install dependencies.

Reboot.

Note: rebooting with mouse and gamepad both connected through the same USB hub seemed to disable both devices. So you may wish to connect at least one directly to the Pi.

Configure

My gamepad-as-mouse defaults to left-thumbstick for movement, and buttons 1 and 2 mapped directly.

If this does not suit, use QJoyPad to remap the joystick input.

You'll have to run QJoyPad it every session unless you set it to run on startup.

Troubleshoot

Use jstest-gtk from the joystick package to test if your device is being detected.

Note

I wrote this because I could find no other guides on the internet. Feel free to suggest fixes.

Comments

Popular posts from this blog

Early Retirement Examined

What more can a poor boy do? Early retirement is based on the idea that cutting the cost of living decreases the amount of time required to build a source of passive income to fund that cost of living . Saving 50% of your income equates to retirement in 17 years. Five years is a common claim for practitioners. At least, for ones who blog about it. However, early retirement blogs like Mr Money Mustache , Early Retirement Extreme , and Go Curry Cracker ignore the limitations of this practice, particularly for those on low incomes.

Raspberry Pi DLNA Media Server

Stream media from your Raspberry Pi to tablets, consoles, and other devices using MiniDLNA. Hardware Raspberry Pi (preferably running Raspbian) Stonking great USB hard drive full of music, movies, and other goodies.  Why this rocks Because you won't have to lug around your stonking great hard drive all over your house. Because you'll have access to your media library from all devices. Because the Raspberry Pi runs silent. No fan noises.