diff --git a/kitty/data-types.h b/kitty/data-types.h index 7de3bb8d4..efd374ed0 100644 --- a/kitty/data-types.h +++ b/kitty/data-types.h @@ -42,6 +42,7 @@ typedef unsigned long long id_type; typedef uint32_t char_type; typedef uint32_t color_type; typedef uint16_t hyperlink_id_type; +typedef int key_type; #define HYPERLINK_MAX_NUMBER UINT16_MAX typedef uint16_t combining_type; typedef uint32_t pixel; diff --git a/kitty/glfw.c b/kitty/glfw.c index 32c9e8e07..e970f2cba 100644 --- a/kitty/glfw.c +++ b/kitty/glfw.c @@ -22,10 +22,6 @@ extern size_t cocoa_get_workspace_ids(void *w, size_t *workspace_ids, size_t arr extern monotonic_t cocoa_cursor_blink_interval(void); -#if GLFW_KEY_LAST >= MAX_KEY_COUNT -#error "glfw has too many keys, you should increase MAX_KEY_COUNT" -#endif - static GLFWcursor *standard_cursor = NULL, *click_cursor = NULL, *arrow_cursor = NULL; static void set_os_window_dpi(OSWindow *w); @@ -261,9 +257,6 @@ key_callback(GLFWwindow *w, GLFWkeyevent *ev) { } } global_state.callback_os_window->cursor_blink_zero_time = monotonic(); - if (ev->key >= 0 && ev->key <= GLFW_KEY_LAST) { - global_state.callback_os_window->is_key_pressed[ev->key] = ev->action == GLFW_RELEASE ? false : true; - } if (is_window_ready_for_callbacks()) on_key_input(ev); global_state.callback_os_window = NULL; request_tick_callback(); diff --git a/kitty/state.h b/kitty/state.h index a260f160f..1b559155a 100644 --- a/kitty/state.h +++ b/kitty/state.h @@ -135,8 +135,6 @@ typedef struct { BorderRects border_rects; } Tab; -#define MAX_KEY_COUNT 512 - typedef struct { int x, y, w, h; bool is_set; @@ -173,7 +171,6 @@ typedef struct { double logical_dpi_x, logical_dpi_y, font_sz_in_pts; bool mouse_button_pressed[32]; PyObject *window_title; - bool is_key_pressed[MAX_KEY_COUNT]; bool viewport_size_dirty, viewport_updated_at_least_once; LiveResizeInfo live_resize; bool has_pending_resizes, is_semi_transparent, shown_once, is_damaged;