Date: | 2010-01-16 |
---|
Contents
Uinput allows attaching user-space device drivers into the Linux kernel. As magnificient as the uinput-system is, it is pretty low level from the application developers perspective. Libsuinput provides a higher level API and hides many devilish details.
Linux kernel 2.6.x
uinput module installed:
sudo modprobe -i uinput
Add uinput to the modules automatically loaded on boot if it's not already there:
sudo sh -c "echo uinput >> /etc/modules"
If uinput is desired to be used without root-privileges, create udev-rules for it:
sudo sh -c "echo KERNEL==\"uinput\", MODE=\"0666\" > /etc/udev/rules.d/50-suinput.rules"
Change uinput access rights for the current session:
# udevadm info --query=env --name=input/uinput | grep DEVNAME | sed s'/DEVNAME=//' | xargs sudo chmod 0666 find /dev -regex .*/uinput$ | xargs sudo chmod 0666
Move pointer and then generate a left mouse button click:
#include <suinput.h> int main(void) { struct suinput_driver *driver = suinput_open(NULL, NULL); suinput_move_pointer(driver, 100, 100); suinput_click(driver, BTN_LEFT); suinput_close(driver); return 0; }
Tarball is available at: /libsuinput/0.2/libsuinput-0.2.tar.gz
Latest sources from public git-repository: http://github.com/tuos/libsuinput/
git clone git://github.com/tuos/libsuinput.git
The install-procedure adheres the "standard":
./configure --prefix=/usr/local make && sudo make install
Report bugs by sending email to tuos@codegrove.org or by opening an issue at http://github.com/tuos/libsuinput/issues .