From bb9d791a62808b973c8258edd921d1c78e0b1df4 Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Tue, 12 Mar 2024 14:39:03 -0300 Subject: [PATCH] get shortcuts working again --- config.h | 10 ++++++---- makefile | 2 +- rose | Bin 39008 -> 39008 bytes rose.c | 9 ++++++++- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/config.h b/config.h index b6f3005..7fff23a 100644 --- a/config.h +++ b/config.h @@ -1,5 +1,7 @@ -#include #include +#include +// Previously: #include +// But GTK now discourages including the individual headers // Key user config #define WIDTH 1920 // 960 for half-width, 1920 for full width @@ -82,8 +84,8 @@ static struct { { CTRL, KEY(h), goback }, { CTRL, KEY(j), goforward }, { CTRL, KEY(r), refresh }, - { CTRL | SFT, KEY(R), refresh_force }, - { CTRL | SFT, KEY(H), back_to_home }, + { CTRL, KEY(R), refresh_force }, + { CTRL, KEY(H), back_to_home }, { CTRL, KEY(equal), zoomin }, { CTRL, KEY(minus), zoomout }, { CTRL, KEY(0), zoom_reset }, @@ -96,7 +98,7 @@ static struct { { CTRL, KEY(semicolon), hide_bar }, { CTRL, KEY(f), show_finder }, { CTRL, KEY(n), finder_next }, - { CTRL | SFT, KEY(N), finder_prev }, + { CTRL, KEY(N), finder_prev }, { CTRL, KEY(p), prettify } }; /* ^ For controls more akin to normal browsers */ diff --git a/makefile b/makefile index 25aa387..44723ae 100644 --- a/makefile +++ b/makefile @@ -64,7 +64,7 @@ fast: $(SRC) $(PLUGINS) $(CONFIG) rm -f *.gcda lint: - clang-tidy $(SRC) $(PLUGINS) -- -Wall -O3 `pkg-config --cflags 'webkit2gtk-4.0'` -o rose `pkg-config --libs 'webkit2gtk-4.0'` + clang-tidy $(SRC) $(PLUGINS) -- -Wall -O3 `pkg-config --cflags 'webkit2gtk-4.1'` -o rose `pkg-config --libs 'webkit2gtk-4.1'` inspect: build GTK_DEBUG=interactive ./rose diff --git a/rose b/rose index 623f8b9c360d40c1adf72f65b59d5e7f95e6fd39..d6a6f8d67efc4a314f7b7fc34b9906ef7af6482e 100755 GIT binary patch delta 73 zcmaE`f$6~prVSa)A}LWRz0y6CzHYKE@hUy%{CB3<{lv{R%>LMzz_t)%s|XCxiD=uBg{VLI%28JLYW(H!`$%SdN8Cf^;rUx4W0BOe=fB*mh 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,