Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Global key binding made easy

Project description

LBC Python 2

release lic ci coverage


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.


  • 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 keybind import KeyBinder

def do():

# The following will start key listening loop in a thread
# (useful if you don't want to block your main program).

    'Ctrl-K': do,
    'Shift-R': None,  # Do not run anything, just intercept.

}, run_thread=True)

From CLI

; Listen to Ctrl-K, Ctrl-R and D (keycode 40).
; Provide as many -k as you want.
$ keybind -k "Ctrl-K=ls -lah" -k "Ctrl-R=python somearg --someopt" -k "40=date"

; 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.

Files for keybind, version 0.3.0
Filename, size File type Python version Upload date Hashes
Filename, size keybind-0.3.0-py2.py3-none-any.whl (6.6 kB) File type Wheel Python version 3.6 Upload date Hashes View
Filename, size keybind-0.3.0.tar.gz (7.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page