+
+KeyCode modkeys_sym_to_code(KeySym sym)
+{
+ gint i, j;
+
+ /* 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;
+}
+