This repository aims to provide a uinput driver for the Nintendo Switch Pro Controller when connected via USB.
- Map the inputs of a connected Pro Controller to a virtual Microsoft Xbox 360 controller.
- Allows swapping A-B and/or X-Y buttons to match the written layout.
- Allows inverting each the axis (and dpad) individually.
- Simple rumble support.
- Option to print buttons pressing and axis to a terminal.
- Option to calibrate each axis in case of problems.
- Low response times.
- Experimental bluetooth support.
- It is not enabled by default. See the section Enable experimental bluetooth support.
- See Known issues.
- At the time, only one controller is supported.
// TODO
The driver needs the following to run:
- hidapi
On a Debian-based distro (Ubuntu, Pop!_Os, etc) you can install these in a terminal with:
sudo apt-get install libhidapi-libusb0 libhidapi-hidraw0If you're having trouble with inverted axis, use ./procon_driver --help to see how to invert the axis.
There's also an option to run with A and B as well as X and Y buttons switched, if you prefer the button output as they're written on the pad as opposed to XBox layout.
The following is needed to build the driver:
- cmake
- clang++
- hidapi
On a Debian-based distro (Ubuntu, Pop!_Os, etc) you can install these in a terminal with:
sudo apt install cmake
sudo apt install clang
sudo apt install libhidapi-devAs a one liner:
sudo apt install cmake clang libhidapi-dev- Download the source code (via
git cloneor zip file) to a folder. - Navigate to that folder in a terminal.
- Run the script
install_rules.shwith root privileges to install the udev rules.- Those are required to be able to run the driver without root privileges.
- Run the script
cbuild.shto build the driver. - The driver will be in the build folder.
The following is an example of the steps above:
git clone https://github.com/AngheloAlf/SwitchProConLinuxUSB.git procon_driver
cd procon_driver/
sudo ./install_rules.sh
./cbuild.shAssuming you already have the source code, you have to edit the file CMakeLists.txt and change the hidapi-libusb line to hidapi-hidraw line, then recompile the driver.
- Support for multiple controller at the same time.
- Joy-cons support.
- Wired (charging grip) and bluetooth.
- IMU sensors (accelerometer and gyroscope) support.
- Probably will expose them as new axis for each one.
- Button re-mapping.
- Fix the known issues and bugs.
- Find currently unknown issues.
- Add more bugs to fix later.
- Non-official and third party controllers support.
- If you have one, and you are willing to help, open an issue!
- Some kind of scanning mode, or controller hot-plugging.
- Play MIDI files using the hd rumble.
See Changelog.
In case you have any problem using this driver, first see the Known issues section. If your problem is not listed there, or you have new info on some problem, just open an Issue describing your problem and your system.
- If the driver was recently closed and then reopened, it could struggle to connect to the controller. Just keep trying, or replug the cable.
- The driver is not compatible with Steam.
- Trying to use this driver when Steam is open, makes the controller unusable in both platforms.
- This happens because Steam sees the controller and tries to connect with it.
- The controller randomly disconnects.
Contributing is highly appreciated. Just open a new Issue or Pull request.
You can also propose new features in the Issues section.
- Everyone that has helped in https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering.
- The original project: https://github.com/FrotBot/SwitchProConLinuxUSB.
- Which is based and inspired on https://github.com/MTCKC/ProconXInput/tree/v0.1.0-alpha2.
- Everyone in https://gitlab.com/fabis_cafe/game-devices-udev for the udev rules.