Joystick acts as a mouse, even when I'm playing a game that uses a joystick so I get random mouse events going on.

I plugged a joystick in to play Spiral Knights, also installed joystick and jcalibrate. Everything is working good, except by default the joystick moves the mouse around and the button activate mouse keys.

Now normally this would be good behavior if I'm on a Myth-box or something, unfortunately when I play Spiral Knights with joystick input I see my mouse cursor moving in the back ground and when I hit a button it thinks I'm pressing right-click so it minimizes everything. Also it creates folders and probably deletes stuff.

So, basically how the heck do I stop it from acting as a mouse?

  • Can you show what PC you have and joystick you are using. Also what Ubuntu version. – Luis Alvarado Apr 16 '11 at 16:17
  • I'm using a playstation 2 to usb adapter, under the jscalibrate it's listed as: GreenAsia Inc. USB Joystick. I'm running Ubuntu 10.10 – Shazzner Apr 17 '11 at 6:28

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.

  • Hooray that did it! I think that got tacked on when I added the joystick package in synaptic. It works great now! – Shazzner Apr 19 '11 at 8:54
  • I had this problem also and it fixed it. Many thanks for answering, much appreciated! – b1ackcrow Feb 25 '12 at 20:27
  • Is there a way to turn off/on this feaature? Is kindda cool controling the mouse with the gamepad but it should be nice to turn it on when i do need it – chepe263 May 26 '12 at 21:32
  • thank's darent, this worked on Arch Linux too! Was trying to play Dustforce, and this was really annoying me. – Marco Scannadinari Oct 17 '13 at 8:08
  • 1
    FYI I had to log out and back in also. And in Manjaro linux, the package name was xf86-input-joystick. – Peter Aug 18 '15 at 13:56

put this code in a file:

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").

  • It looks like the format of the "xinput list" lines have changed. – Phoeey Sep 23 '13 at 12:00
  • This code need changes to work under Ubuntu 18.04 LTS. The output has changed. – Hans Deragon Dec 30 '18 at 17:09

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

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.

  • Because this is a new solution for a) a different controller and b) has different functionality to the given scripts. I don't see how editing an existing answer would change that. – hochl Nov 6 '16 at 21:42
  • Good enough for me! Upvoted so it'll rise to the top! ;-) – Fabby Nov 6 '16 at 22:01

You perhaps should be using jscal to calibrate your joystick - you can use the -u option as per the manual page to configure the joystick to not use the mouse buttons.

There is some interesting stuff about the various joysticks & gamepads on ubuntuforums as well.

  • Is there a way to configure this without generating then editing an xorg.conf file? (I'm already using jscal to calibrate the joystick) – Shazzner Apr 17 '11 at 6:34
  • I use jstest-gtk it's in the repos i think. – animaletdesequia Apr 30 '11 at 15:29

Try Qjoypad or (if you don't want to use QT) the slighlty less featured rejoystick (GTK). This way you don't have to edit/create xorg.conf.

They both are available on playdeb

Understanding joystick drivers is kind of a mess, everything seems to be either outdated or unfinished... Good luck!

  • 1
    These are great programs but unfortunately didn't solve my problem as rebinding them didn't make the issue go away. – Shazzner Apr 19 '11 at 8:56

I am using Linux Mint 17.3 and I was having this same problem. I had the onlive console and I was going to throw away the controller. I didn't know it would work, but It connected easily through bluetooth. The left joystick was controlling the mouse and I search and try different methods but none of them worked. I'm posting this so it can help other people. I followed the fix from the Ubuntu Sixaxis setup page. I had to add this configuration to the xorg.conf file:

Section "InputClass"
    Identifier "joystick catchall"
    MatchIsJoystick "on"
    MatchDevicePath "/dev/input/event*"
    Driver "joystick"
    Option "StartKeysEnabled" "False"       #Disable mouse
    Option "StartMouseEnabled" "False"      #support


It works perfectly after logging out. The only problem is if the xorg.conf is updated like after installing a new graphics driver, it will lose it. Can someone explain me how to create a script that checks the configuration is in the file, if not, write it after each reboot? Thanks in advanced.


1- You should see your joystick number first ... so Run Terminal and type xinpute list ,and look to your joystick number and replace its number instead of the 10 in the Example below.

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

2- Creat a new Document then put the code in it , then rename it to name.sh Format 3- Run Terminal then put the path where you save the file .

Example : cd Desktop (Because i saved mine on the Desktop)

4- Type bash name.sh ( Click Enter and You are Done ! )

Note1: to Turn it back on just change the 0 on the last 2 lines to 1 Note2: if this doesn't work make sure to remove xserver-xorg-input-joystick and /usr/lib/X11/xorg.conf.d/10-joystick


Matias Parmigiani's answer was the key for me. However, the format of the xinput list has changed, at least on Ubuntu 13.04 LTS...

⎜   ↳ DragonRise Inc.   Generic   USB  Joystick     id=12   [slave  pointer  (2)]
    ↳ DragonRise Inc.   Generic   USB  Joystick   (keys)    id=11   [slave  keyboard (3)]

As a result I needed to use the following in my disablement script:

id=`xinput list | grep -P "DragonRise Inc.   Generic   USB  Joystick\s+id=" | grep -oP "id=\d+"| cut -c4-5`
props_mouse=`xinput list-props $id | grep "Generate Mouse Events" | grep -oP "\(\d+"| cut -c2-5`
props_teclado=`xinput list-props $id | grep "Generate Key Events" | grep -oP "\(\d+"| cut -c2-5`
xinput set-prop "$id" "$props_mouse" 0
xinput set-prop "$id" "$props_teclado" 0

Hope this helps!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.