Joystick acts as mouse; won't stop

Uninstall xserver-xorg-input-joystick.

It's a package to control the mouse with the joystick. I only installed once to test it and it was driving me mad, so maybe that's the problem. I think the joystick would work the same without it.


put this code in a file:

#!/bin/bash
id=`xinput list | grep "↳ DragonRise Inc.   Generic   USB  Joystick     id=" | cut -c58-59`
props_mouse=`xinput list-props $id | grep "Generate Mouse Events (" | cut -c25-27`
props_teclado=`xinput list-props $id | grep "Generate Key Events (" | cut -c23-25`
xinput set-prop $id $props_mouse 0
xinput set-prop $id $props_teclado 0

save it, right button in rights and tick "mark this file as a program"

execute it and you will have your joystick "as joystick again" (and the best, you can have your joystick as mouse again if you change the "0" in the last two lines with "1").


I just had the same problem, but with a Playstation 3 controller. Using the answers as a template, I expanded on the solution:

#!/bin/bash
id=`xinput list | grep -P "PLAYSTATION.*pointer" | grep -oP "id=\d+" | grep -oP "\d+"`
props=`xinput list-props $id`
# echo "$props"
props_mouse=(`echo "$props" | grep "Generate Mouse Events" | grep -oP "\d+"`)
props_keyboard=(`echo "$props" | grep "Generate Key Events" | grep -oP "\d+"`)
xinput set-prop $id ${props_mouse[0]} $[1-${props_mouse[1]}]
xinput set-prop $id ${props_keyboard[0]} $[1-${props_mouse[1]}]

This version of the script will enable or disable the controller, depending on the current settings, like a toggle.