Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/idlesign/keybind
Global key binding made easy
https://github.com/idlesign/keybind
hotkeys keybindings linux python unix x11
Last synced: about 1 month ago
JSON representation
Global key binding made easy
- Host: GitHub
- URL: https://github.com/idlesign/keybind
- Owner: idlesign
- License: bsd-3-clause
- Created: 2018-11-15T13:35:07.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-17T11:42:56.000Z (over 4 years ago)
- Last Synced: 2024-09-29T15:43:23.626Z (about 1 month ago)
- Topics: hotkeys, keybindings, linux, python, unix, x11
- Language: Python
- Homepage: https://github.com/idlesign/keybind
- Size: 19.5 KB
- Stars: 15
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG
- Contributing: CONTRIBUTING
- License: LICENSE
Awesome Lists containing this project
README
keybind
=======
https://github.com/idlesign/keybind.. image:: https://idlesign.github.io/lbc/py2-lbc.svg
:target: https://idlesign.github.io/lbc/
:alt: LBC Python 2|release| |lic| |ci| |coverage|
.. |release| image:: https://img.shields.io/pypi/v/keybind.svg
:target: https://pypi.python.org/pypi/keybind.. |lic| image:: https://img.shields.io/pypi/l/keybind.svg
:target: https://pypi.python.org/pypi/keybind.. |ci| image:: https://img.shields.io/travis/idlesign/keybind/master.svg
:target: https://travis-ci.org/idlesign/keybind.. |coverage| image:: https://img.shields.io/coveralls/idlesign/keybind/master.svg
:target: https://coveralls.io/r/idlesign/keybindDescription
-----------*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
~~~~~~~~~~~.. code-block:: python
from keybind 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
~~~~~~~~.. code-block:: bash
; 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