Skip to main content

Global key binding made easy

Project description

https://github.com/idlesign/keybind

release lic

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, Ctrl-R and D (keycode 40).
; Provide as many -k as you want.
$ keybind -k "Ctrl-K=ls -lah" -k "Ctrl-R=python run.py 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.

Filename, size & hash SHA256 hash help File type Python version Upload date
keybind-0.2.0-py2.py3-none-any.whl (6.7 kB) Copy SHA256 hash SHA256 Wheel 2.7
keybind-0.2.0.tar.gz (6.2 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page