summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ui/documentwidget.c8
-rw-r--r--src/ui/keys.c5
2 files changed, 10 insertions, 3 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c
index 3373771d..8f2fc437 100644
--- a/src/ui/documentwidget.c
+++ b/src/ui/documentwidget.c
@@ -132,6 +132,7 @@ enum iDocumentWidgetFlag {
132 noHoverWhileScrolling_DocumentWidgetFlag = iBit(2), 132 noHoverWhileScrolling_DocumentWidgetFlag = iBit(2),
133 showLinkNumbers_DocumentWidgetFlag = iBit(3), 133 showLinkNumbers_DocumentWidgetFlag = iBit(3),
134 setHoverViaKeys_DocumentWidgetFlag = iBit(4), 134 setHoverViaKeys_DocumentWidgetFlag = iBit(4),
135 newTabViaHomeKeys_DocumentWidgetFlag = iBit(5),
135}; 136};
136 137
137enum iDocumentLinkOrdinalMode { 138enum iDocumentLinkOrdinalMode {
@@ -1789,6 +1790,8 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd)
1789 iChangeFlags(d->flags, showLinkNumbers_DocumentWidgetFlag, iTrue); 1790 iChangeFlags(d->flags, showLinkNumbers_DocumentWidgetFlag, iTrue);
1790 iChangeFlags(d->flags, setHoverViaKeys_DocumentWidgetFlag, 1791 iChangeFlags(d->flags, setHoverViaKeys_DocumentWidgetFlag,
1791 argLabel_Command(cmd, "hover") != 0); 1792 argLabel_Command(cmd, "hover") != 0);
1793 iChangeFlags(d->flags, newTabViaHomeKeys_DocumentWidgetFlag,
1794 argLabel_Command(cmd, "newtab") != 0);
1792 } 1795 }
1793 invalidateVisibleLinks_DocumentWidget_(d); 1796 invalidateVisibleLinks_DocumentWidget_(d);
1794 refresh_Widget(d); 1797 refresh_Widget(d);
@@ -2203,7 +2206,10 @@ static iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e
2203 } 2206 }
2204 else { 2207 else {
2205 postCommandf_App("open newtab:%d url:%s", 2208 postCommandf_App("open newtab:%d url:%s",
2206 openTabMode_Sym(SDL_GetModState()), 2209 d->ordinalMode ==
2210 numbersAndAlphabet_DocumentLinkOrdinalMode
2211 ? openTabMode_Sym(SDL_GetModState())
2212 : (d->flags & newTabViaHomeKeys_DocumentWidgetFlag ? 1 : 0),
2207 cstr_String(absoluteUrl_String( 2213 cstr_String(absoluteUrl_String(
2208 d->mod.url, linkUrl_GmDocument(d->doc, run->linkId)))); 2214 d->mod.url, linkUrl_GmDocument(d->doc, run->linkId))));
2209 } 2215 }
diff --git a/src/ui/keys.c b/src/ui/keys.c
index 941dda54..a4e5c6fc 100644
--- a/src/ui/keys.c
+++ b/src/ui/keys.c
@@ -75,9 +75,10 @@ static const struct { int id; iMenuItem bind; int flags; } defaultBindings_[] =
75 { 32, { "Go to parent directory", navigateParent_KeyShortcut, "navigate.parent" }, 0 }, 75 { 32, { "Go to parent directory", navigateParent_KeyShortcut, "navigate.parent" }, 0 },
76 { 33, { "Go to site root", navigateRoot_KeyShortcut, "navigate.root" }, 0 }, 76 { 33, { "Go to site root", navigateRoot_KeyShortcut, "navigate.root" }, 0 },
77 { 35, { "Reload page", reload_KeyShortcut, "document.reload" }, 0 }, 77 { 35, { "Reload page", reload_KeyShortcut, "document.reload" }, 0 },
78 { 40, { "Open link via home row keys", 'f', 0, "document.linkkeys arg:1" }, 0 },
79 { 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 },
80 { 45, { "Hover on link via home row keys", 'f', KMOD_SHIFT, "document.linkkeys arg:1 hover:1" }, 0 }, 79 { 42, { "Open link via home row keys", 'f', 0, "document.linkkeys arg:1" }, 0 },
80 { 45, { "Open link in new tab via home row keys", 'f', KMOD_SHIFT, "document.linkkeys arg:1 newtab:1" }, 0 },
81 { 46, { "Hover on link via home row keys", 'h', 0, "document.linkkeys arg:1 hover:1" }, 0 },
81 { 70, { "Zoom in", SDLK_EQUALS, KMOD_PRIMARY, "zoom.delta arg:10" }, 0 }, 82 { 70, { "Zoom in", SDLK_EQUALS, KMOD_PRIMARY, "zoom.delta arg:10" }, 0 },
82 { 71, { "Zoom out", SDLK_MINUS, KMOD_PRIMARY, "zoom.delta arg:-10" }, 0 }, 83 { 71, { "Zoom out", SDLK_MINUS, KMOD_PRIMARY, "zoom.delta arg:-10" }, 0 },
83 { 72, { "Reset zoom", SDLK_0, KMOD_PRIMARY, "zoom.set arg:100" }, 0 }, 84 { 72, { "Reset zoom", SDLK_0, KMOD_PRIMARY, "zoom.set arg:100" }, 0 },