From d31817fe01d80e7f1977136f12b378b88d99616f Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Wed, 9 Dec 2020 21:54:19 +0200 Subject: Added keybindings for zooming --- src/ui/bindingswidget.c | 1 + src/ui/keys.c | 7 +++++++ 2 files changed, 8 insertions(+) (limited to 'src') diff --git a/src/ui/bindingswidget.c b/src/ui/bindingswidget.c index dee844db..9a2070ba 100644 --- a/src/ui/bindingswidget.c +++ b/src/ui/bindingswidget.c @@ -165,6 +165,7 @@ static iBool processEvent_BindingsWidget_(iBindingsWidget *d, const SDL_Event *e if (item) { reset_Binding(item->id); updateItems_BindingsWidget_(d); + postCommand_App("bindings.changed"); } return iTrue; } diff --git a/src/ui/keys.c b/src/ui/keys.c index 0a0295ac..6dc28237 100644 --- a/src/ui/keys.c +++ b/src/ui/keys.c @@ -76,11 +76,18 @@ static const struct { int id; iMenuItem bind; int flags; } defaultBindings_[] = { 33, { "Go to site root", navigateRoot_KeyShortcut, "navigate.root" }, 0 }, { 40, { "Open link via home row keys", 'f', 0, "document.linkkeys arg:1" }, 0 }, { 41, { "Open link via modifier key", SDLK_LALT, 0, "document.linkkeys arg:0" }, argRelease_BindFlag }, + { 70, { "Zoom in", SDLK_EQUALS, KMOD_PRIMARY, "zoom.delta arg:10" }, 0 }, + { 71, { "Zoom out", SDLK_MINUS, KMOD_PRIMARY, "zoom.delta arg:-10" }, 0 }, + { 72, { "Reset zoom", SDLK_0, KMOD_PRIMARY, "zoom.set arg:100" }, 0 }, { 80, { "Previous tab", prevTab_KeyShortcut, "tabs.prev" }, 0 }, { 81, { "Next tab", nextTab_KeyShortcut, "tabs.next" }, 0 }, /* The following cannot currently be changed (built-in duplicates). */ { 1000, { NULL, SDLK_SPACE, KMOD_SHIFT, "scroll.page arg:-1" }, argRepeat_BindFlag }, { 1001, { NULL, SDLK_SPACE, 0, "scroll.page arg:1" }, argRepeat_BindFlag }, +#if defined (iPlatformApple) + { 1002, { NULL, SDLK_LEFTBRACKET, KMOD_PRIMARY, "navigate.back" }, 0 }, + { 1003, { NULL, SDLK_RIGHTBRACKET, KMOD_PRIMARY, "navigate.forward" }, 0 }, +#endif }; static iBinding *findId_Keys_(iKeys *d, int id) { -- cgit v1.2.3