-
-
Notifications
You must be signed in to change notification settings - Fork 39.2k
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
X-Macros for keycode definitions. #21078
Conversation
Random selection of 100 boards show SHA1s match. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
X()
is already used by Unicodemap (for now)... and I feel like this is overcomplicating things a little.
For now, will change it to This is mainly for future work with scripting languages, inserting text-equivalent names into the scripting VM. Example: // Register keycodes
const struct keycode_table_entry {
const char *name;
int value;
} keycode_table[] = {
#define REGISTER_KEYCODE(name, value) {#name, name},
FOREACH_QK_KEYCODE(REGISTER_KEYCODE)
#undef REGISTER_KEYCODE
{NULL, 0}};
LUAMOD_API void register_globals(lua_State *L) {
for (const struct keycode_table_entry *e = keycode_table; e->name != NULL; e++) {
lua_pushinteger(L, e->value);
lua_setglobal(L, e->name);
}
} |
35909f1
to
5c24ae4
Compare
I share similar concerns, could we not just generate a different header from the cli? I guess that would be my preference. Would the test header not be close to whats required? |
As of #21092 There's also the sendstring keycodes which use an |
No probs, will move further discussion to Discord. |
Description
Converts keycode generation to X-Macros. Useful for conversion to text-equivalents.
Types of Changes
Checklist