changeset 1409:78b152208bc1

allow keysyms in keysrc
author corvid <corvid@lavabit.com>
date Wed, 04 Nov 2009 17:33:31 +0000
parents e59742ef792a
children ee6d755fc63e
files ChangeLog src/keys.cc src/keysrc
diffstat 3 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Nov 04 16:59:54 2009 +0000
+++ b/ChangeLog	Wed Nov 04 17:33:31 2009 +0000
@@ -47,6 +47,7 @@
  - Fix segfault when radio button lacks name attribute.
  - Enable popup menu below bottom of page content (BUG#856).
  - Handle JPEGs with CMYK color space.
+ - Allow keysyms in keysrc.
    Patches: corvid
 +- Support for the letter-spacing property.
    Patch: Johannes Hofmann, corvid
--- a/src/keys.cc	Wed Nov 04 16:59:54 2009 +0000
+++ b/src/keys.cc	Wed Nov 04 17:33:31 2009 +0000
@@ -11,6 +11,7 @@
 
 #include <fltk/events.h>
 #include <stdio.h>
+#include <stdlib.h>        /* strtol */
 #include <string.h>
 #include <ctype.h>
 
@@ -310,6 +311,9 @@
    // Get key code
    if (!key[1]) {
       keycode = *key;
+   } else if (key[0] == '0' && key[1] == 'x') {
+      /* keysym. For details on values reported, see fltk's fltk/events.h */
+      keycode = strtol(key, NULL, 0x10);
    } else if ((st = getKeyCode(keystr)) == -1) {
       MSG("Keys::parseKey unknown keyname: %s\n", keystr);
    } else {
--- a/src/keysrc	Wed Nov 04 16:59:54 2009 +0000
+++ b/src/keysrc	Wed Nov 04 17:33:31 2009 +0000
@@ -10,6 +10,10 @@
 # "F1" through "F12", "Home", "Insert", "Left", "PageDown", "PageUp",
 # "Print", "Return", "Right", "Space", "Tab", "Up".
 #
+# If Dillo is running under X11, keys whose names are not recognized can
+# be specified using their keysym value in hexadecimal. Use xev to get
+# the keysym. Example rule: "0x1008ff27 = forward".
+#
 # The action "nop" (no operation) can be used to remove a binding.
 
 # "open" lets you browse your local files for one to open.