Skip to content

Commit f8718ac

Browse files
committed
Changed readme to reStructuredText
1 parent c992cd6 commit f8718ac

1 file changed

Lines changed: 29 additions & 30 deletions

File tree

README renamed to README.rst

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
===============
2-
Python-uinput
1+
Python-uinput
32
===============
43

54
Python-uinput is Python interface to Linux uinput kernel module which
@@ -14,41 +13,41 @@ Homepage: <http://tjjr.fi/sw/python-uinput/>
1413
Usage 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

4645
See examples/ for other kind of example devices (keyboard, joystick).
4746

4847
Note that you must have the uinput kernel module loaded to use
4948
python-uinput. To load the module, run:
5049

51-
modprobe -i uinput
50+
modprobe -i uinput
5251

5352
If you would like to have uinput to be loaded on every sytem boot, add
5453
uinput to /etc/modules.
@@ -58,16 +57,16 @@ How to install
5857

5958
Just 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

6463
How to report bugs
6564
==================
6665

6766
The bug database is hosted in GitHub. If you have found a bug or have an
6867
improvement 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
7170
bug has already been reported. If so, you can still subscribe to the existing
7271
bug to track its progress.
7372

@@ -78,7 +77,7 @@ In addition to reporting bugs and improvement suggestions, you are encouraged to
7877
contribute bug-fixes or features. The source code is maintained in Git and the
7978
main 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
8281
old patches via email are also accepted.
8382

8483
How to copy

0 commit comments

Comments
 (0)