*state |= m;
}
- /* figure out the keycode */
- sym = XStringToKeysym(l);
- if (sym == NoSymbol) {
- g_warning("Invalid key name '%s' in key binding.", l);
- goto translation_fail;
+ if (!g_ascii_strncasecmp("0x", l, 2)) {
+ gchar *end;
+
+ /* take it directly */
+ *keycode = strtol(l, &end, 16);
+ if (*l == '\0' || *end != '\0') {
+ g_warning("Invalid key code '%s' in key binding.", l);
+ goto translation_fail;
+ }
+ } else {
+ /* figure out the keycode */
+ sym = XStringToKeysym(l);
+ if (sym == NoSymbol) {
+ g_warning("Invalid key name '%s' in key binding.", l);
+ goto translation_fail;
+ }
+ *keycode = XKeysymToKeycode(ob_display, sym);
}
- *keycode = XKeysymToKeycode(ob_display, sym);
if (!*keycode) {
g_warning("Key '%s' does not exist on the display.", l);
goto translation_fail;