summaryrefslogtreecommitdiff
path: root/config.h
diff options
context:
space:
mode:
authorEnno Boland (tox) <tox@s01.de>2009-09-07 09:44:21 +0200
committerEnno Boland (tox) <tox@s01.de>2009-09-07 09:44:21 +0200
commitf0e0656f38682d54d8b981fe579767d4fa9638fd (patch)
tree732a80a527c03725e30152578abe39619b114180 /config.h
parent4156e0aa51ae1e8925537aa4814acfb6eed4923b (diff)
downloadsurf-f0e0656f38682d54d8b981fe579767d4fa9638fd.tar.gz
surf-f0e0656f38682d54d8b981fe579767d4fa9638fd.tar.bz2
surf-f0e0656f38682d54d8b981fe579767d4fa9638fd.zip
changes to the event system, make config.h saner, working on cookies
Diffstat (limited to 'config.h')
-rw-r--r--config.h69
1 files changed, 24 insertions, 45 deletions
diff --git a/config.h b/config.h
index 6c13e86..a46843c 100644
--- a/config.h
+++ b/config.h
@@ -1,47 +1,26 @@
/* modifier 0 means no modifier */
-static Key searchbar_keys[] = {
- /* modifier keyval function arg stop event */
- { 0, GDK_Escape, hidesearch, {0}, TRUE },
- { 0, GDK_Return, searchtext, {.b = TRUE}, TRUE },
- { GDK_SHIFT_MASK, GDK_Return, searchtext, {.b = FALSE}, TRUE },
- { GDK_SHIFT_MASK, GDK_Left, NULL, {0}, FALSE },
- { GDK_SHIFT_MASK, GDK_Right, NULL, {0}, FALSE },
-};
-
-static Key urlbar_keys[] = {
- /* modifier keyval function arg stop event */
- { 0, GDK_Escape, hideurl, {0}, TRUE },
- /* able to "chain" commands; by setting stop event to FALSE */
- { 0, GDK_Return, loaduri, {.v = NULL}, FALSE },
- { 0, GDK_Return, hideurl, {0}, TRUE },
- { GDK_SHIFT_MASK, GDK_Left, NULL, {0}, FALSE },
- { GDK_SHIFT_MASK, GDK_Right, NULL, {0}, FALSE },
-};
-
-static Key general_keys[] = {
- /* modifier keyval function arg stop event */
- { GDK_CONTROL_MASK, GDK_P, print, {0}, TRUE },
- { GDK_CONTROL_MASK, GDK_p, clipboard, {.b = TRUE }, TRUE },
- { GDK_CONTROL_MASK, GDK_y, clipboard, {.b = FALSE}, TRUE },
- { GDK_CONTROL_MASK, GDK_R, reload, {.b = TRUE}, TRUE },
- { GDK_CONTROL_MASK, GDK_r, reload, {.b = FALSE}, TRUE },
- { GDK_CONTROL_MASK, GDK_b, NULL, {0}, TRUE },
- { GDK_CONTROL_MASK, GDK_g, showurl, {0}, TRUE },
- { GDK_CONTROL_MASK, GDK_slash, showsearch, {0}, TRUE },
- { GDK_CONTROL_MASK, GDK_plus, zoompage, {0}, TRUE },
- { GDK_CONTROL_MASK, GDK_minus, zoompage, {.f = -1.0 }, TRUE },
- { GDK_CONTROL_MASK, GDK_0, zoompage, {.f = +1.0 }, TRUE },
- { GDK_CONTROL_MASK, GDK_n, searchtext, {.b = TRUE}, TRUE },
- { GDK_CONTROL_MASK, GDK_N, searchtext, {.b = FALSE}, TRUE },
- { GDK_CONTROL_MASK, GDK_l, navigate, {.i = +1}, TRUE },
- { GDK_CONTROL_MASK, GDK_h, navigate, {.i = -1}, TRUE },
- { 0, GDK_Escape, stop, {0}, TRUE },
-};
-
-/* Sequence of Keys to match against a keypress */
-static KeySet keysets[] = {
- /* keyset (Key[]) numkeys focusedwidget/mode */
- { searchbar_keys, LENGTH(searchbar_keys), SEARCHBAR },
- { urlbar_keys, LENGTH(urlbar_keys), URLBAR },
- { general_keys, LENGTH(general_keys), NONE },
+static Key keys[] = {
+ /* modifier keyval function arg Focus */
+ { 0, GDK_Escape, hidesearch, {0}, ALWAYS },
+ { 0, GDK_Escape, hideurl, {0}, ALWAYS },
+ { GDK_CONTROL_MASK, GDK_P, print, {0}, ALWAYS },
+ { 0, GDK_Return, searchtext, {.b = TRUE}, SEARCHBAR },
+ { GDK_SHIFT_MASK, GDK_Return, searchtext, {.b = FALSE}, SEARCHBAR },
+ { GDK_CONTROL_MASK, GDK_n, searchtext, {.b = TRUE}, BROWSER|SEARCHBAR },
+ { GDK_CONTROL_MASK, GDK_N, searchtext, {.b = FALSE}, BROWSER|SEARCHBAR },
+ { 0 },
+ { GDK_CONTROL_MASK, GDK_R, reload, {.b = TRUE}, ALWAYS },
+ { GDK_CONTROL_MASK, GDK_r, reload, {.b = FALSE}, ALWAYS },
+ { GDK_CONTROL_MASK, GDK_g, showurl, {0}, ALWAYS },
+ { GDK_CONTROL_MASK, GDK_slash, showsearch, {0}, ALWAYS },
+ { 0, GDK_Return, loaduri, {.v = NULL}, URLBAR },
+ { 0, GDK_Return, hideurl, {0}, URLBAR },
+ { GDK_CONTROL_MASK, GDK_p, clipboard, {.b = TRUE }, BROWSER },
+ { GDK_CONTROL_MASK, GDK_y, clipboard, {.b = FALSE}, BROWSER },
+ { GDK_CONTROL_MASK, GDK_plus, zoompage, {.i = +1 }, BROWSER },
+ { GDK_CONTROL_MASK, GDK_minus, zoompage, {.i = -1 }, BROWSER },
+ { GDK_CONTROL_MASK, GDK_0, zoompage, {.i = 0 }, BROWSER },
+ { GDK_CONTROL_MASK, GDK_l, navigate, {.i = +1}, BROWSER },
+ { GDK_CONTROL_MASK, GDK_h, navigate, {.i = -1}, BROWSER },
+ { 0, GDK_Escape, stop, {0}, BROWSER },
};