progund / swinput Goto Github PK
View Code? Open in Web Editor NEWSoftware Input devices for Linux
License: GNU General Public License v3.0
Software Input devices for Linux
License: GNU General Public License v3.0
Swinput can fake mouse and keyboard input using the Linux Input System. The swinput modules read from a device and fake hardware events (mouse motions, keyboard input, etc). Swinput presents status on the proc filesystem. As of May 2006 only kernel 2.6 is supported. 1 Building and installing ======================================== tar zxvf swinput-0.5.tar.gz make make install (as root) If you are using devfs you are finished with building and installation. Otherwise you have to create the devices manually; ** You most likely don't need to exec the below commands ** mknod /dev/swmouse c 10 $(grep swmouse /proc/misc | awk '{print $1}') mknod /dev/swkeybd c 10 $(grep swkeybd /proc/misc | awk '{print $1}') make try inserts the modules (using sudo) make check runs the test scripts in test/ (using sudo) make dist builds a dist package (incl gpg sig) for upload 2 Mouse Usage ======================================== Load module with "modprobe swmouse" type "modinfo swmouse" to get a list of possible arguments. - You can define the maximum screen resolution using the "xmax" and "ymax" module-parameters. Use the "devs" parameter if you need more than one fake-mouse. Currently a maximum of 16 different fake-devices are supported. -Supress any syslog output by using "log=0". To see general messages use "log=1" and for full debugging output use "log=2" (please use "log=2" when reporting bugs) - By writing to /dev/swmouse0 you can fake 'mouse input'. The following syntax is used Option Interpretation --------- --------------------------------- u nr Moves the mouse up <nr> pixels d nr Moves the mouse down <nr> pixels l nr Moves the mouse left <nr> pixels r nr Moves the mouse right <nr> pixels x nr Moves the mouse to x position=<nr> (untested) y nr Moves the mouse to y position=<nr> (untested) 0 Moves to origin and resets stats 3 Keyboard Usage ======================================== Load module with "modprobe swkeybd" By writing to /dev/swkeybd you can fake 'keyboard input'. The following syntax is used Option Interpretation --------- --------------------------------- str The string 'str' is typed by the faked keyboard [Fx] The key Fx (e.g F2) is pressed. x can be 1-20 [KEY_BACKSPACE] Backspace is typed [KEY_ENTER] Enter is typed [KEY_SPACE] Space is typed [KEY_COMMA] , is typed [KEY_DOT] . is typed [KEY_LEFT] Left (arrow) key is typed [KEY_RIGHT] Right (arrow) key is typed [KEY_DOWN] Down (arrow) key is typed [KEY_UP] Up (arrow) key is typed 4 Usage staticstics ======================================== In the proc tree (/proc) you'll find usage statistics. 4.1 swmouse usage statistics ---------------------------------------- If you read /proc/swmouse (e.g. by typing cat /proc/swmouse) you get the following information: swmouseX:u:d:l:r:x:y where: X mouse-device u means the number of pixels we've moved up so far d means the number of pixels we've moved down so far l means the number of pixels we've moved left so far r means the number of pixels we've moved right so far x means the number of times we've moved to a fix x position y means the number of times we've moved to a fix y position You can zero the statistics counters by writing zero to the proc file (e.g echo "0" > /dev/swmouse) 4.2 swkeybd usage statistics ---------------------------------------- If you read /proc/swkeybd (e.g. by typing cat /proc/swkeybd) you get the following information: swkeybd:p:r:s_p:s_r where: p means the number of key presses so far r means the number of key releases so far s_p means the number of shift key presses so far s_r means the number of shift key releases so far You can set the statistics counters to zero by writing zero to the proc file (e.g echo "0" > /dev/swkeybd) 5 Examples ======================================== echo "u 10" > /dev/swmouse0 Moves the pointer up 10 pixels echo "d 123" > /dev/swmouse0 Moves the pointer down 123 pixels echo "ls -l [ENTER]" > /dev/swkeybd Types 'ls -l' followed by enter .. so you should see a file/dir listing if you have as your focus a terminal emulator or a console. 6 Bugs ======================================== Please report bugs at http://savannah.nongnu.org/bugs/?group=swinput
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.