Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for a tool that will generate a json file of all of our Key_ macros. #1411

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

obra
Copy link
Member

@obra obra commented Mar 21, 2024

This is...nowhere near ready. The individual parts almost work for key definitions inside the core of Kaleidoscope, but don't handle plugins yet.

Right now, the way to run this tooling is:

 sh etc/generate-keylist/extract-keys.sh
 sh etc/generate-keylist/generate-macro-printer.sh                                                                                    
clang++ -DKALEIDOSCOPE_GENERATE_KEY_DEFINITIONS -I src/ -std=c++11 /tmp/list-macros.cpp

extract-keys.sh is going to need to be a lot smarter to handle plugins and the path of least resistance may involve refactoring some plugins to make their key macros easier to extract.

a file listing all possible keycodes

- Extracted key definition constants to `key_def_constants.h`
- Moved base key definitions to `key_defs/base.h`
- Moved legacy key definitions to `key_defs/legacy.h`
- Updated `key_defs.h` to include the new headers and remove now redundant definitions
- Ensured compatibility and organization of key definitions across the codebase
- Added `extract-keys.sh` to extract argument-taking and non-argument-taking macros from key definitions.
- Added `generate-macro-printer.sh` to generate a C++ program for printing macro values.
files ontaining only key definitions to make introspection and codegen
around lists of keys more straightforward
- Removed extra spaces for consistency in `key_defs/legacy.h`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant