Comment 31 for bug 285323

Revision history for this message
Saivann Carignan (oxmosys) wrote : Re: Losing keyboard and mouse control when changing screen brightness with fn + arrow under intrepid

This regression appeared with revision 2857 of gnome power manager which fixed another similar regression introduced by revision 2845. Revision 2845 caused "g", "k" and ";" keys to stop working.

Revision 2857 :
--- trunk/src/gpm-button.c 2008/07/29 01:31:15 2856
+++ trunk/src/gpm-button.c 2008/08/01 08:39:15 2857
@@ -166,11 +166,19 @@
  * Return value: TRUE if we parsed and grabbed okay
  **/
 static gboolean
-gpm_button_xevent_key (GpmButton *button, guint keycode, const gchar *hal_key)
+gpm_button_xevent_key (GpmButton *button, guint keysym, const gchar *hal_key)
 {
  gchar *key = NULL;
  gboolean ret;
  gchar *keycode_str;
+ guint keycode;
+
+ /* convert from keysym to keycode */
+ keycode = XKeysymToKeycode (GDK_DISPLAY (), keysym);
+ if (keycode == 0) {
+ gpm_warning ("could not map keysym %x to keycode", keysym);
+ return FALSE;
+ }

  /* is the key string already in our DB? */
  keycode_str = g_strdup_printf ("0x%x", keycode);