summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-12-09 21:54:19 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-12-09 21:54:19 +0200
commitd31817fe01d80e7f1977136f12b378b88d99616f (patch)
tree2b0323626b04d1af36836aa249bfd7d681f2a519 /src/ui
parent9f33d1694878746f181d5d36090f34dbfeba7183 (diff)
Added keybindings for zooming
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/bindingswidget.c1
-rw-r--r--src/ui/keys.c7
2 files changed, 8 insertions, 0 deletions
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
165 if (item) { 165 if (item) {
166 reset_Binding(item->id); 166 reset_Binding(item->id);
167 updateItems_BindingsWidget_(d); 167 updateItems_BindingsWidget_(d);
168 postCommand_App("bindings.changed");
168 } 169 }
169 return iTrue; 170 return iTrue;
170 } 171 }
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_[] =
76 { 33, { "Go to site root", navigateRoot_KeyShortcut, "navigate.root" }, 0 }, 76 { 33, { "Go to site root", navigateRoot_KeyShortcut, "navigate.root" }, 0 },
77 { 40, { "Open link via home row keys", 'f', 0, "document.linkkeys arg:1" }, 0 }, 77 { 40, { "Open link via home row keys", 'f', 0, "document.linkkeys arg:1" }, 0 },
78 { 41, { "Open link via modifier key", SDLK_LALT, 0, "document.linkkeys arg:0" }, argRelease_BindFlag }, 78 { 41, { "Open link via modifier key", SDLK_LALT, 0, "document.linkkeys arg:0" }, argRelease_BindFlag },
79 { 70, { "Zoom in", SDLK_EQUALS, KMOD_PRIMARY, "zoom.delta arg:10" }, 0 },
80 { 71, { "Zoom out", SDLK_MINUS, KMOD_PRIMARY, "zoom.delta arg:-10" }, 0 },
81 { 72, { "Reset zoom", SDLK_0, KMOD_PRIMARY, "zoom.set arg:100" }, 0 },
79 { 80, { "Previous tab", prevTab_KeyShortcut, "tabs.prev" }, 0 }, 82 { 80, { "Previous tab", prevTab_KeyShortcut, "tabs.prev" }, 0 },
80 { 81, { "Next tab", nextTab_KeyShortcut, "tabs.next" }, 0 }, 83 { 81, { "Next tab", nextTab_KeyShortcut, "tabs.next" }, 0 },
81 /* The following cannot currently be changed (built-in duplicates). */ 84 /* The following cannot currently be changed (built-in duplicates). */
82 { 1000, { NULL, SDLK_SPACE, KMOD_SHIFT, "scroll.page arg:-1" }, argRepeat_BindFlag }, 85 { 1000, { NULL, SDLK_SPACE, KMOD_SHIFT, "scroll.page arg:-1" }, argRepeat_BindFlag },
83 { 1001, { NULL, SDLK_SPACE, 0, "scroll.page arg:1" }, argRepeat_BindFlag }, 86 { 1001, { NULL, SDLK_SPACE, 0, "scroll.page arg:1" }, argRepeat_BindFlag },
87#if defined (iPlatformApple)
88 { 1002, { NULL, SDLK_LEFTBRACKET, KMOD_PRIMARY, "navigate.back" }, 0 },
89 { 1003, { NULL, SDLK_RIGHTBRACKET, KMOD_PRIMARY, "navigate.forward" }, 0 },
90#endif
84}; 91};
85 92
86static iBinding *findId_Keys_(iKeys *d, int id) { 93static iBinding *findId_Keys_(iKeys *d, int id) {