]> Dogcows Code - chaz/openbox/blobdiff - obt/keyboard.c
reflect the change that parse.c/h was renamed to xml.c/h in the file header comments
[chaz/openbox] / obt / keyboard.c
index 710a94c23b33ccad97af9421f514214a71b474e8..264201a670f7efcf9cb334c668f1c3baa946e557 100644 (file)
@@ -49,7 +49,7 @@ static gboolean hyper_l = FALSE;
 
 static gboolean started = FALSE;
 
-void obt_keyboard_reload()
+void obt_keyboard_reload(void)
 {
     gint i, j, k;
 
@@ -97,7 +97,7 @@ void obt_keyboard_reload()
     modkeys_keys[OBT_KEYBOARD_MODKEY_CONTROL] = ControlMask;
 }
 
-void obt_keyboard_shutdown()
+void obt_keyboard_shutdown(void)
 {
     XFreeModifiermap(modmap);
     modmap = NULL;
@@ -185,16 +185,24 @@ static void set_modkey_mask(guchar mask, KeySym sym)
     /* CapsLock, Shift, and Control are special and hard-coded */
 }
 
-KeyCode obt_keyboard_keysym_to_keycode(KeySym sym)
+KeyCode* obt_keyboard_keysym_to_keycode(KeySym sym)
 {
-    gint i, j;
+    KeyCode *ret;
+    gint i, j, n;
+
+    ret = g_new(KeyCode, 1);
+    n = 0;
+    ret[n] = 0;
 
     /* go through each keycode and look for the keysym */
     for (i = min_keycode; i <= max_keycode; ++i)
         for (j = 0; j < keysyms_per_keycode; ++j)
-            if (sym == keymap[(i-min_keycode) * keysyms_per_keycode + j])
-                return i;
-    return 0;
+            if (sym == keymap[(i-min_keycode) * keysyms_per_keycode + j]) {
+                ret = g_renew(KeyCode, ret, ++n);
+                ret[n-1] = i;
+                ret[n] = 0;
+            }
+    return ret;
 }
 
 gchar *obt_keyboard_keycode_to_string(guint keycode)
This page took 0.021658 seconds and 4 git commands to generate.