1- ===============
2- Python-uinput
1+ Python-uinput
32===============
43
54Python-uinput is Python interface to Linux uinput kernel module which
@@ -14,41 +13,41 @@ Homepage: <http://tjjr.fi/sw/python-uinput/>
1413Usage examples
1514==============
1615
17- Generate keyboard clicks:
16+ **Generate keyboard clicks: **
17+
18+ import uinput
19+
20+ with uinput.Device([uinput.KEY_E, uinput.KEY_H,
21+ uinput.KEY_L, uinput.KEY_O]) as device:
22+ device.emit_click(uinput.KEY_H)
23+ device.emit_click(uinput.KEY_E)
24+ device.emit_click(uinput.KEY_L)
25+ device.emit_click(uinput.KEY_L)
26+ device.emit_click(uinput.KEY_O)
27+
28+ **Move mouse cursor: **
1829
19- import uinput
20-
21- with uinput.Device([uinput.KEY_E, uinput.KEY_H,
22- uinput.KEY_L, uinput.KEY_O]) as device:
23- device.emit_click(uinput.KEY_H)
24- device.emit_click(uinput.KEY_E)
25- device.emit_click(uinput.KEY_L)
26- device.emit_click(uinput.KEY_L)
27- device.emit_click(uinput.KEY_O)
30+ import uinput
2831
29- Move mouse cursor:
32+ with uinput.Device([uinput.REL_X, uinput.REL_Y,
33+ uinput.BTN_LEFT, uinput.BTN_RIGHT]) as device:
34+ for i in range(20):
35+ device.emit(uinput.REL_X, 5)
36+ device.emit(uinput.REL_Y, 5)
3037
31- import uinput
32-
33- with uinput.Device([uinput.REL_X, uinput.REL_Y,
34- uinput.BTN_LEFT, uinput.BTN_RIGHT]) as device:
35- for i in range(20):
36- device.emit(uinput.REL_X, 5)
37- device.emit(uinput.REL_Y, 5)
38+ **Generate keyboard combinations: **
3839
39- Generate keyboard combinations:
40+ import uinput
4041
41- import uinput
42-
43- with uinput.Device([uinput.KEY_LEFTALT, uinput.KEY_TAB]) as device:
44- device.emit_combo([uinput.KEY_LEFTALT, uinput.KEY_TAB])
42+ with uinput.Device([uinput.KEY_LEFTALT, uinput.KEY_TAB]) as device:
43+ device.emit_combo([uinput.KEY_LEFTALT, uinput.KEY_TAB])
4544
4645See examples/ for other kind of example devices (keyboard, joystick).
4746
4847Note that you must have the uinput kernel module loaded to use
4948python-uinput. To load the module, run:
5049
51- modprobe -i uinput
50+ modprobe -i uinput
5251
5352If you would like to have uinput to be loaded on every sytem boot, add
5453uinput to /etc/modules.
@@ -58,16 +57,16 @@ How to install
5857
5958Just run the following commands:
6059
61- python setup.py build
62- python setup.py install
60+ python setup.py build
61+ python setup.py install
6362
6463How to report bugs
6564==================
6665
6766The bug database is hosted in GitHub. If you have found a bug or have an
6867improvement idea you want to share, please report it at
6968<https://github.com/tuomasjjrasanen/python-uinput/issues>. However, to avoid
70- duplicate bug reports, before reporting, please check if similiar or identical
69+ duplicate bug reports, before reporting, please check if similar or identical
7170bug has already been reported. If so, you can still subscribe to the existing
7271bug to track its progress.
7372
@@ -78,7 +77,7 @@ In addition to reporting bugs and improvement suggestions, you are encouraged to
7877contribute bug-fixes or features. The source code is maintained in Git and the
7978main repository is hosted at GitHub,
8079<https://github.com/tuomasjjrasanen/python-uinput/>. The preferred way to
81- contibute code is to clone the main Git repository and send a pull-request. Good
80+ contribute code is to clone the main Git repository and send a pull-request. Good
8281old patches via email are also accepted.
8382
8483How to copy
0 commit comments