# xlib-hotkeys
[![pypi](https://img.shields.io/pypi/v/xlib-hotkeys.svg)](https://pypi.python.org/pypi/xlib-hotkeys)
![python version](https://img.shields.io/pypi/pyversions/xlib-hotkeys.svg)
![license](https://img.shields.io/pypi/l/xlib-hotkeys.svg)
Python library for Linux to register keyboard combinations to a callback function.
## Requirements
* Python 3.7 or later
## Installation
Install using:
```
pip install xlib-hotkeys
```
## Usage
You can use this module from the command line
```bash
xlib-hotkeys -h
xlib-hotkeys -d :0 -k ctrl+return shift+f2
```
```python
from xlib_hotkeys import HotKeysManager
def KeyDown(key, keyspressed):
print(f"Keys Pressed: {keyspressed}")
def Hotkey1():
print(f" Hotkey1 detected")
def Hotkey2():
print(f" Hotkey2 detected")
hk = HotKeysManager(display_str=":0")
hk.KeyDown = KeyDown
hk.hotkeys["ctrl+return"] = Hotkey1()
hk.hotkeys["shift+f2"] = Hotkey2()
hk.start()
time.sleep(50)
hk.stop()
```
Raw data
{
"_id": null,
"home_page": "https://github.com/bkbilly/xlib_hotkeys",
"name": "xlib-hotkeys",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7.0",
"maintainer_email": null,
"keywords": "keyboard, hotkeys",
"author": null,
"author_email": "bkbilly <bkbilly@hotmail.com>",
"download_url": "https://files.pythonhosted.org/packages/80/cb/13aaffbd3e9dc729dd41ab6baa2432ff7874ea789fb4b218474e2af0a711/xlib_hotkeys-2024.3.0.tar.gz",
"platform": null,
"description": "# xlib-hotkeys\n\n[![pypi](https://img.shields.io/pypi/v/xlib-hotkeys.svg)](https://pypi.python.org/pypi/xlib-hotkeys)\n![python version](https://img.shields.io/pypi/pyversions/xlib-hotkeys.svg)\n![license](https://img.shields.io/pypi/l/xlib-hotkeys.svg)\n\nPython library for Linux to register keyboard combinations to a callback function.\n\n\n## Requirements\n* Python 3.7 or later\n\n\n## Installation\nInstall using:\n```\npip install xlib-hotkeys\n```\n\n\n## Usage\nYou can use this module from the command line\n```bash\nxlib-hotkeys -h\nxlib-hotkeys -d :0 -k ctrl+return shift+f2\n```\n\n```python\nfrom xlib_hotkeys import HotKeysManager\n\n\ndef KeyDown(key, keyspressed):\n print(f\"Keys Pressed: {keyspressed}\")\n\n\ndef Hotkey1():\n print(f\" Hotkey1 detected\")\n\n\ndef Hotkey2():\n print(f\" Hotkey2 detected\")\n\n\nhk = HotKeysManager(display_str=\":0\")\nhk.KeyDown = KeyDown\nhk.hotkeys[\"ctrl+return\"] = Hotkey1()\nhk.hotkeys[\"shift+f2\"] = Hotkey2()\n\nhk.start()\ntime.sleep(50)\nhk.stop()\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "Register Keyboard Hotkeys to a callback function",
"version": "2024.3.0",
"project_urls": {
"Homepage": "https://github.com/bkbilly/xlib_hotkeys",
"Source Code": "https://github.com/bkbilly/xlib_hotkeys"
},
"split_keywords": [
"keyboard",
" hotkeys"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5da21e88b5862b2bd93e7316417250e505c767fe18d3491f8a3ceb5022710c90",
"md5": "07a81736b4c6b299d4051776ac0d1304",
"sha256": "ea3afbd683ebf794aa8411a917c1688e0c04fae80f9110a1feece7ed0d5c025c"
},
"downloads": -1,
"filename": "xlib_hotkeys-2024.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "07a81736b4c6b299d4051776ac0d1304",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7.0",
"size": 4856,
"upload_time": "2024-03-25T15:42:16",
"upload_time_iso_8601": "2024-03-25T15:42:16.733395Z",
"url": "https://files.pythonhosted.org/packages/5d/a2/1e88b5862b2bd93e7316417250e505c767fe18d3491f8a3ceb5022710c90/xlib_hotkeys-2024.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "80cb13aaffbd3e9dc729dd41ab6baa2432ff7874ea789fb4b218474e2af0a711",
"md5": "374796fd8af5ff8ee74c4c95ca54f8e6",
"sha256": "2911a8678e4e814e5438c6489930c8ae04d714fcda00dd0dfc8bc77a89d6d945"
},
"downloads": -1,
"filename": "xlib_hotkeys-2024.3.0.tar.gz",
"has_sig": false,
"md5_digest": "374796fd8af5ff8ee74c4c95ca54f8e6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7.0",
"size": 4203,
"upload_time": "2024-03-25T15:42:17",
"upload_time_iso_8601": "2024-03-25T15:42:17.888430Z",
"url": "https://files.pythonhosted.org/packages/80/cb/13aaffbd3e9dc729dd41ab6baa2432ff7874ea789fb4b218474e2af0a711/xlib_hotkeys-2024.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-25 15:42:17",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "bkbilly",
"github_project": "xlib_hotkeys",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "xlib-hotkeys"
}