Python non-blocking terminal keyboard/mouse event detection for any presented to stdin
Project description
evHID
events in python for HID devices (currently only keyboard) that can detect everykey in the terminal: due to the nature of the terminal - while every key is detected not every key is reported to the terminal this means that when the terminal loses focus detection continues untill detectable key is pressed - you can pass callback functions to work globally (so key detection works in the backround aswell) - can be blocking or none blocking, -match on keys by name or value or character ex: if key == 'right' will match the right arrowkey key == '0x20' will match the space key - events reported using signal: instead of using time.sleep(0.01) you can use from signals import pause while True: #code for matching here pause()
note for self XKKEYSYMS modifiers : & | 0x00ff | 00255 & | 0xff00 | 65280
\x1b\x5b\x41 ansiesc | ANSI|ASCII | XLIB | PYNPUT
uparrow | 0x1b5b41 : | 0x08FC : 2300 | 0xff52 : 65362
| backspace | \b | 0x08 : 0xFF08 : 65288 | 0xfecc : 65288 |
|---|---|---|---|
| \ | 0x5c | 0x005c | |
| esc | 0x1b | 0xFF1b | 0xff1b |
| [ | 0x5b | 0x005b | |
| A | 0x41 | 0x0041 | |
| Xlib |
| XLIB |
keysym | 0x08FC | 2300 |up arrow | 0x0800 | 2048 | 0x00FC | 0252 -------|--------|[]
=======|========|= pynput | 0xff52 | 65362 |up arrow | 0x0052 | 82 | R
0x00ff0d| 65293
0x00ff00| 65280
0x00000d| 13
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file evhid-0.1.0.tar.gz.
File metadata
- Download URL: evhid-0.1.0.tar.gz
- Upload date:
- Size: 40.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04c18ae16a74361e077d9e129d42846553ed09ff22a25c0a678a7f4306736088
|
|
| MD5 |
7db988cfcac844b3bd2881ed4fa11532
|
|
| BLAKE2b-256 |
c3206c95ee553906bce3584be93d15fb40d6ca5c741836876157e3c82c9b09f7
|
File details
Details for the file evhid-0.1.0-py3-none-any.whl.
File metadata
- Download URL: evhid-0.1.0-py3-none-any.whl
- Upload date:
- Size: 23.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f54101a81cf3e9186b8371f6a1ffc5d5baa96574618622815f535a3c06b41d0b
|
|
| MD5 |
1ff3ef462d524ea952439fee08fedf04
|
|
| BLAKE2b-256 |
5b0c771559284c4d2f3ee1f89cabba25237ce2f14f17bdf774c7f11bc7eaeaa8
|