get shortcuts working again
This commit is contained in:
parent
8907cbb063
commit
bb9d791a62
10
config.h
10
config.h
|
@ -1,5 +1,7 @@
|
||||||
#include <gdk/gdkkeysyms.h>
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <gdk/gdk.h>
|
||||||
|
// Previously: #include <gdk/gdkkeysyms.h>
|
||||||
|
// But GTK now discourages including the individual headers
|
||||||
|
|
||||||
// Key user config
|
// Key user config
|
||||||
#define WIDTH 1920 // 960 for half-width, 1920 for full width
|
#define WIDTH 1920 // 960 for half-width, 1920 for full width
|
||||||
|
@ -82,8 +84,8 @@ static struct {
|
||||||
{ CTRL, KEY(h), goback },
|
{ CTRL, KEY(h), goback },
|
||||||
{ CTRL, KEY(j), goforward },
|
{ CTRL, KEY(j), goforward },
|
||||||
{ CTRL, KEY(r), refresh },
|
{ CTRL, KEY(r), refresh },
|
||||||
{ CTRL | SFT, KEY(R), refresh_force },
|
{ CTRL, KEY(R), refresh_force },
|
||||||
{ CTRL | SFT, KEY(H), back_to_home },
|
{ CTRL, KEY(H), back_to_home },
|
||||||
{ CTRL, KEY(equal), zoomin },
|
{ CTRL, KEY(equal), zoomin },
|
||||||
{ CTRL, KEY(minus), zoomout },
|
{ CTRL, KEY(minus), zoomout },
|
||||||
{ CTRL, KEY(0), zoom_reset },
|
{ CTRL, KEY(0), zoom_reset },
|
||||||
|
@ -96,7 +98,7 @@ static struct {
|
||||||
{ CTRL, KEY(semicolon), hide_bar },
|
{ CTRL, KEY(semicolon), hide_bar },
|
||||||
{ CTRL, KEY(f), show_finder },
|
{ CTRL, KEY(f), show_finder },
|
||||||
{ CTRL, KEY(n), finder_next },
|
{ CTRL, KEY(n), finder_next },
|
||||||
{ CTRL | SFT, KEY(N), finder_prev },
|
{ CTRL, KEY(N), finder_prev },
|
||||||
{ CTRL, KEY(p), prettify }
|
{ CTRL, KEY(p), prettify }
|
||||||
};
|
};
|
||||||
/* ^ For controls more akin to normal browsers */
|
/* ^ For controls more akin to normal browsers */
|
||||||
|
|
2
makefile
2
makefile
|
@ -64,7 +64,7 @@ fast: $(SRC) $(PLUGINS) $(CONFIG)
|
||||||
rm -f *.gcda
|
rm -f *.gcda
|
||||||
|
|
||||||
lint:
|
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
|
inspect: build
|
||||||
GTK_DEBUG=interactive ./rose
|
GTK_DEBUG=interactive ./rose
|
||||||
|
|
9
rose.c
9
rose.c
|
@ -381,8 +381,15 @@ int handle_signal_keypress(void* self, GdkEvent* event, GtkNotebook* notebook)
|
||||||
{
|
{
|
||||||
(void)self;
|
(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++)
|
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);
|
return handle_shortcut(shortcut[i].id, notebook);
|
||||||
/*
|
/*
|
||||||
If I wanted to bind button presses, like the extra button in the mouse,
|
If I wanted to bind button presses, like the extra button in the mouse,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user