mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-16 13:34:48 +02:00
Store key combos that need special handling in a table for fast lookup
This commit is contained in:
@@ -23,6 +23,12 @@ key_to_bytes(int glfw_key, bool smkx, bool extended, int mods, int action) {
|
||||
return key_bytes[key];
|
||||
}
|
||||
|
||||
void
|
||||
set_special_key_combo(int glfw_key, int mods) {
|
||||
int k = (glfw_key & 0x7f) | ( (mods & 0xF) << 7);
|
||||
needs_special_handling[k] = true;
|
||||
}
|
||||
|
||||
#define PYWRAP1(name) static PyObject* py##name(PyObject UNUSED *self, PyObject *args)
|
||||
#define PA(fmt, ...) if(!PyArg_ParseTuple(args, fmt, __VA_ARGS__)) return NULL;
|
||||
#define M(name, arg_type) {#name, (PyCFunction)py##name, arg_type, NULL}
|
||||
|
||||
Reference in New Issue
Block a user