https://github.com/zewenn/zig-keycode-generator
A python script that generates zig-keycode-enums from a given dataset
https://github.com/zewenn/zig-keycode-generator
Last synced: 4 months ago
JSON representation
A python script that generates zig-keycode-enums from a given dataset
- Host: GitHub
- URL: https://github.com/zewenn/zig-keycode-generator
- Owner: zewenn
- License: apache-2.0
- Created: 2024-08-23T08:58:12.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-23T10:50:28.000Z (almost 2 years ago)
- Last Synced: 2025-11-17T04:34:25.075Z (7 months ago)
- Language: Python
- Size: 18.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# zig-keycode-generator
A python script that generates zig-keycode-enums from a given dataset
> [!WARNING]
> This project isn't perfect, and won't be able to map all keys automatically. If you encounter an error, please open the [`resources.py`](./generator/resources.py) file and look up the keywords accepted by the program.
## How to use?
```py
import generator
generator.use_dataset({ ... })
document = generator.generate("my_enum_name", generator.MENUM)
document.save()
```
> [!TIP]
> This will save the `my_enum_name.zig` file to [`out`](./out/).
> See an example of the config file in [`IOKit_OsX.py`](./IOKit_OsX.py)