Global key binding made easy
Project description
https://github.com/idlesign/keybind
Description
Global key binding made easy
Requires X11 (X Window System). For UNIX-like systems, e.g. Linux.
Can be used both as a Python package and from CLI.
Features:
Create some global key bindings to your functions.
Use them in your GUI or CLI application.
Bind arbitrary program run to a key using CLI.
From Python
from keybinder import KeyBinder
def do():
print('done')
# The following will start key listening loop in a thread
# (useful if you don't want to block your main program).
KeyBinder.activate({
'Ctrl-K': do,
'Shift-R': None, # Do not run anything, just intercept.
}, run_thread=True)
From CLI
; Listen to Ctrl-K and Ctrl-D.
; Provide as many -k as you want.
$ keybind -k "Ctrl-K=ls -lah" -k "Ctrl-D=python run.py somearg --someopt"
; All keys interception mode. Show keycodes.
; Use wisely, keep your mouse ready.
$ keybind --sniff
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
keybind-0.1.1.tar.gz
(6.1 kB
view hashes)
Built Distribution
Close
Hashes for keybind-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c36054e062f721b8fed70c49d73b10e7a8dde44523799829cbfdf95a5cbb29c1 |
|
MD5 | f72044832d446e509040e16fe28e8b13 |
|
BLAKE2b-256 | 8850c2b6efd6449195423a47e639bac7e551c1bf23205515c35536823b0c9985 |