https://github.com/blobbybilb/keyui.py
A keyboard user interface framework for python
https://github.com/blobbybilb/keyui.py
Last synced: about 1 year ago
JSON representation
A keyboard user interface framework for python
- Host: GitHub
- URL: https://github.com/blobbybilb/keyui.py
- Owner: blobbybilb
- License: gpl-3.0
- Created: 2023-04-05T06:25:36.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-05T06:50:10.000Z (about 3 years ago)
- Last Synced: 2024-05-30T02:14:40.998Z (about 2 years ago)
- Language: Python
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# KeyUI.py
A keyboard user interface framework for python
### What's a "keyboard user interface"?
I was working on a project that does something when `\\\\\` is typed (anywhere, eg. in a text document). I wrote this simple class as a part of that; as it could have more general uses, I called it "KeyUI.py" for keyboard user iterface (because I couldn't think of anything else) and put it here.
### Usage
download the keyUI.py file
```python
from keyUI import KeyUI
```
#### from the KeyUI class:
Usage:
1. Initialize KeyUI -- `KeyUI()`
2. Set handler -- `KeyUI().set_handler(handler_func)` where `handler_func` is a function that takes a list of strings as an argument.
3. Run -- `KeyUI().run()`
Example:
```
def handler(args: list[str]):
print(args)
KeyUI().set_handler(handler).run()
```
---
Custom separator and delimiter (Note: not yet supported, may not work):
set `KeyUI().separator`/`KeyUI().delimiter` to your custom separator/delimiter
### License
GNU GPLv3