psmoveinput is a userspace Linux input driver that uses data from PSMove motion controller to inject events to kernel's input subsystem thus making it possible to use PSMove as a combined mouse/keyboard input device. It gives users ability to control mouse pointer movements by moving PSMove controller and map PSMove keys to common keyboard keys.
psmoveinput requires the following software to be installed:
- uinput module (modprobe uinput as root)
- python (recent versions of both branches 2 and 3 should work fine)
bluez and boost libraries should be present in most distributions' repos. psmoveapi should be compiled and installed from source.
See INSTALL.md for instructions on how to build and install psmoveinput.
Configuring and running
psmoveinput recognizes several command-line options and reads its configuration from a file. The location of configuration file is specified with -c or --config command line options. During psmoveinput installation default configuration file is installed to /etc/psmoveinput.conf. This file contains description of all configurable options. To get the list of all recognized command line options run psmoveinput with -h or --help argument.
Connecting PSMove controller
- Connect PSMove to PC via USB.
- Run "psmovepair" as root. psmovepair is part of psmoveapi (see INSTALL.md for details).
- Disconnect the controller.
- Press the PS button on the PSMove controller. You may see popup indicating Bluetooth connection attempt from the controller (depends on desktop environment used). Authorize it and wait until the PSMove is connected.
- Run "psmoveinput". It will automatically connect to the controller and start injecting input events.
This procedure is necessary only when connecting controller to the system for the first time. After disconnecting controller it can be reconnected by pressing PS button. However, if the same controller is then paired to another system (including Sony PlayStation itself), the procedure has to be repeated in order to reconnect controller to the current system.
psmoveinput supports up to two simultaneously connected controllers. Controller, which is connected first, is used to control the mouse pointer as well as to report key events, while the second one is used only for keys and gestures. There are four gestures supported: up, down, left and right. Each of them can be mapped to any key supported by psmoveinput (see the default config file provided with psmoveinput for details).
Thanks to Thomas Perl and all who contributed to psmoveapi library.