Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit8d79761a448e8b6391f4b348630017516aa07ab8 (patch)
Author
 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
2019-07-06 13:50:28 +0200
Committer
 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
2019-07-06 14:20:21 +0200
Files9c804a6989c60e03ad5164eb9f9dd866a98065a2
goodwolf-8d79761a448e8b6391f4b348630017516aa07ab8.tar
goodwolf-8d79761a448e8b6391f4b348630017516aa07ab8.tar.gz
goodwolf-8d79761a448e8b6391f4b348630017516aa07ab8.zip
Parent71b8af9d8c050ae6a78b76faf118751e2dd5607a (diff)
Add toggling of caret browsing on F7
2 files changed, 14 insertions, 0 deletions
-rw-r--r--badwolf.12
-rw-r--r--badwolf.c12
diff --git a/badwolf.1 b/badwolf.1
index 33b86c0..d2014a2 100644
--- a/badwolf.1
+++ b/badwolf.1
@@ -36,6 +36,8 @@ Focuses on the search entry
Focuses on the location(URL) entry
.It browser C-S-r / C-r, browser F5
Reloads the current tab (with/without clearing cache)
+.It browser F7
+Toggles caret browsing.
.It browser C-[ / C-]
Go back/forward in current tab’s history
.It any A-Left / A-Right
diff --git a/badwolf.c b/badwolf.c
index 9781d31..8b4f289 100644
--- a/badwolf.c
+++ b/badwolf.c
@@ -165,6 +165,17 @@ WebViewCb_close(WebKitWebView *webView, gpointer user_data)
return TRUE;
}
+static void
+toggle_caret_browsing(WebKitWebView *webView)
+{
+ WebKitSettings *settings = webkit_web_view_get_settings(webView);
+
+ webkit_settings_set_enable_caret_browsing(settings,
+ !webkit_settings_get_enable_caret_browsing(settings));
+
+ webkit_web_view_set_settings(webView, settings);
+}
+
/* commonCb_key_press_event: Global callback for keybindings
*
* Theses shortcuts should be avoided as much as possible:
@@ -236,6 +247,7 @@ commonCb_key_press_event(struct Window *window, GdkEvent *event, struct Client *
switch(((GdkEventKey *)event)->keyval)
{
case GDK_KEY_F5: webkit_web_view_reload(browser->webView); return TRUE;
+ case GDK_KEY_F7: toggle_caret_browsing(browser->webView); return TRUE;
}
}
else