From bb9d791a62808b973c8258edd921d1c78e0b1df4 Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Tue, 12 Mar 2024 14:39:03 -0300 Subject: get shortcuts working again --- rose.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'rose.c') diff --git a/rose.c b/rose.c index 775b338..f7d9ccc 100644 --- a/rose.c +++ b/rose.c @@ -381,8 +381,15 @@ int handle_signal_keypress(void* self, GdkEvent* event, GtkNotebook* notebook) { (void)self; + /* + printf("Keypress state: %d\n", event->key.state); + if(event->key.state & GDK_CONTROL_MASK){ + printf("Keypress state is: CONTROL\n"); + } + printf("Keypress value: %d\n", event->key.keyval); + */ for (int i = 0; i < sizeof(shortcut) / sizeof(shortcut[0]); i++) - if ((event->key.state == shortcut[i].mod || shortcut[i].mod == 0x0) && event->key.keyval == shortcut[i].key) + if ((event->key.state & shortcut[i].mod || shortcut[i].mod == 0x0) && event->key.keyval == shortcut[i].key) return handle_shortcut(shortcut[i].id, notebook); /* If I wanted to bind button presses, like the extra button in the mouse, -- cgit v1.2.3