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
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.0.tar.gz
(6.0 kB
view hashes)
Built Distribution
Close
Hashes for keybind-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ed8fae1b4924587e0064ef4105c6825a93807260530785643646f28a316a640 |
|
MD5 | cd3f71701180bdd9acd5d745bf58e87c |
|
BLAKE2b-256 | fecb944a0ffa3ab2b377fb4aab63d25cf062c7b1db7ded5ce4a54cc669f78367 |