All Projects → denilsonsa → Udev Joystick Blacklist

denilsonsa / Udev Joystick Blacklist

Fix for keyboard/mouse/tablet being detected as joystick in Linux

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Udev Joystick Blacklist

Unlockdown
Disabling kernel lockdown on Ubuntu without physical access
Stars: ✭ 62 (-36.08%)
Mutual labels:  linux-kernel
Kernel Exploits
My proof-of-concept exploits for the Linux kernel
Stars: ✭ 1,173 (+1109.28%)
Mutual labels:  linux-kernel
Rc transmitter
An Arduino 2.4GHz and IR remote controller
Stars: ✭ 83 (-14.43%)
Mutual labels:  joystick
Wireless Rc Adapter
🎮 Arduino USB-Joystick adapter for RC receivers with PWM and PPM modulations up to 8 channels.
Stars: ✭ 62 (-36.08%)
Mutual labels:  joystick
Nintendoextensionctrl
Arduino library for communicating with Nintendo extension controllers
Stars: ✭ 67 (-30.93%)
Mutual labels:  joystick
Unijoystick
It is a powerful joystick component for UGUI.
Stars: ✭ 75 (-22.68%)
Mutual labels:  joystick
Segacontroller
Arduino library to read Sega Genesis (Mega Drive) and Master System (Mark III) controllers.
Stars: ✭ 55 (-43.3%)
Mutual labels:  joystick
Lpic 1 Anki Flashcards
Deck of Anki flashcards for the LPIC-1 (Linux System Administrator) exams 101 and 102 of the Linux Professional Institute (LPI).
Stars: ✭ 90 (-7.22%)
Mutual labels:  linux-kernel
Cubostratus
Blazingly fast Linux syscall collector
Stars: ✭ 68 (-29.9%)
Mutual labels:  linux-kernel
Linux 0.11
A heavily commented linux kernel source code in Chinese.
Stars: ✭ 81 (-16.49%)
Mutual labels:  linux-kernel
Traceshark
This is a tool for Linux kernel ftrace and perf events visualization
Stars: ✭ 63 (-35.05%)
Mutual labels:  linux-kernel
Kmon
Linux Kernel Manager and Activity Monitor 🐧💻
Stars: ✭ 1,142 (+1077.32%)
Mutual labels:  linux-kernel
Intel nuc led
Intel NUC7i[x]BN and NUC6CAY LED Control for Linux
Stars: ✭ 77 (-20.62%)
Mutual labels:  linux-kernel
Sutekh
An example rootkit that gives a userland process root permissions
Stars: ✭ 62 (-36.08%)
Mutual labels:  linux-kernel
Bugstick
Joystick widget for Android.
Stars: ✭ 85 (-12.37%)
Mutual labels:  joystick
Kernel
Linux kernel with modifications for Microsoft Surface devices.
Stars: ✭ 57 (-41.24%)
Mutual labels:  linux-kernel
Linux Baytrail Flexx10
Install GNU/Linux on NextBook Flexx 10.1
Stars: ✭ 73 (-24.74%)
Mutual labels:  linux-kernel
Nipplejs
🎮 A virtual joystick for touch capable interfaces.
Stars: ✭ 1,313 (+1253.61%)
Mutual labels:  joystick
Thoron
Thoron Framework is a Linux post-exploitation framework that exploits Linux TCP vulnerability to provide a shell-like connection. Thoron Framework has the ability to create simple payloads to provide Linux TCP attack.
Stars: ✭ 87 (-10.31%)
Mutual labels:  linux-kernel
Gilrs
Game Input Library for Rust - Mirror of https://gitlab.com/gilrs-project/gilrs
Stars: ✭ 81 (-16.49%)
Mutual labels:  joystick

udev-joystick-blacklist

Fix for keyboard/mouse/tablet being detected as joystick in Linux.

There are several devices that, although recognized by kernel as joysticks, are not joysticks. This repository contains rules that will prevent the non-functional /dev/input/js* and /dev/input/event* devices from being recognized as joysticks.

This is just a blacklist, which will always be incomplete (until the actual bug gets fixed). Feel free to add more devices to this list.

How to install

Version that changes permissions to 0000

sudo curl -o /etc/udev/rules.d/51-these-are-not-joysticks.rules \
  https://raw.githubusercontent.com/denilsonsa/udev-joystick-blacklist/master/51-these-are-not-joysticks.rules

Version that removes the device

sudo curl -o /etc/udev/rules.d/51-these-are-not-joysticks-rm.rules \
  https://raw.githubusercontent.com/denilsonsa/udev-joystick-blacklist/master/51-these-are-not-joysticks-rm.rules

Which version should I use?

Personally, I'd try the first version (that sets permissions to 0000) first. If it does not work or if it gives trouble for some reason, I'd try the second version (that removes the device).

The first version (that sets permissions to 0000) seems to work fine across several distros, but some distros (such as OSMC, see also issue #26) may have additional rules that end up setting the permssions back to another value. In such case, the second version (that removes the device) should work.

In the end, it's up to you, and it's about what works best for you and your system.

What's different in after_kernel_4_9/?

A patch has been accepted into Linux kernel 4.9, so that Microsoft devices will not be detected as joysticks anymore. Thus, those devices are not included in after_kernel_4_9/*. Read issue #20 for details.

How it works

Matching

A rule will match if:

  • The subsystem is input;
  • The pair idVendor and idProduct is in this list;
  • Either one of:
    • The device property ID_INPUT_JOYSTICK is set;
    • Or the device name matches js[0-9]*.

Actions

The following actions are taken on each matching rule:

It is not possible to rename a device, so NAME="not-a-joystick%n" will not work.

Learning more about udev rules

Troubleshooting

Look at the generated /dev files: ls -l /dev/input/

Unplug and plug your USB device while monitoring for kernel and udev events: udevadm monitor -p

Look for other udev rules that may interact with the same device: grep -i '\bjs\b\|joystick' /lib/udev/rules.d/* /etc/udev/rules.d/*

Testing joystick detection

These tools list and interact with all available/detected joysticks:

Bug reports and mentions

There are reports of this issue on different distros and projects.

The udev rules in this repository have been added to:

But remember that the version distributed elsewhere might be different than the version on this repository.

Known devices

For the complete list, look at generate_rules.py script.

Contributing

The best ways to contribute are by creating a new issue or by making a pull request. Make sure you mention the device name/description and the vendor/product IDs. The relevant line from lsusb output is usually enough.

This repository contains a list of devices compiled from contributions of several people. I cannot test every single device. If something does not work for you even after you have added the correct rules, please try debugging it on your own system. The output of udevadm monitor -p may prove very helpful. Also look at the output of ls -l /dev/input/.

History of this repository

After suffering with this issue for a long time, I decided to investigate possible fixes and workarounds. Then, in May 2015, after searching a lot for a solution, I've managed to create some udev rules that fixed the issue for my devices and decided to share this solution with other people. Initially, I shared the simple file at GitHub Gist. Over time, people submitted contributions through comments, and keeping that file on Gist was becoming too hard to manage.

In October 2015, I decided to move the file to this GitHub repository. That way, it will be easier to make changes, to fork, to receive notifications, and essentially to maintain it.

Ideally, the bug in the Linux kernel should be fixed, so that this repository (which is essentially just a workaround) wouldn't be needed anymore.

License

Public domain. Feel free to use this project for whatever purpose you want.

Also, feel free to contribute to the project. And, if you have the knowledge and the skills, consider fixing this bug in the Linux kernel itself.

There is no warranty implied by using this project. Use at your own risk.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].