xbindkeys-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xbindkeys-devel] release modifier behaviour


From: Dmitry Klimov
Subject: [Xbindkeys-devel] release modifier behaviour
Date: Fri, 11 May 2012 01:06:50 +0400
User-agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/24.0 Mule/6.0 (HANACHIRUSATO)

Hello.

With autorepeat enabled "Release" modifier doesn't work as expected. While key 
pressed, autorepeat generates Press/Release events again and again:

------------------------
Key release !
e.xkey.keycode=38
e.xkey.state=5
"urxvt"
    Release + Control+Shift + a
got screen 0 for window ab
Start program with fork+exec call
Key press !
e.xkey.keycode=38
e.xkey.state=5
Key release !
e.xkey.keycode=38
e.xkey.state=5
"urxvt"
    Release + Control+Shift + a

...

 etc
------------------------

To ignore autogenerated KeyRelease events we could use 
XkbSetDetectableAutoRepeat (see attachment). 

Thanks.





===File ~/build/xbindkeys.old/autorepeat-fix.diff===========
--- options.h~  2009-01-24 16:13:14.000000000 +0300
+++ options.h   2012-05-11 00:44:24.000000000 +0400
@@ -36,6 +36,7 @@
 extern int have_to_show_binding;
 extern int have_to_get_binding;
 extern int have_to_start_as_daemon;
+extern int detectable_ar;
 
 extern char *geom;
 
--- options.c~  2011-03-09 18:19:44.000000000 +0300
+++ options.c   2012-05-11 00:46:40.000000000 +0400
@@ -42,6 +42,7 @@
 int have_to_show_binding = 0;
 int have_to_get_binding = 0;
 int have_to_start_as_daemon = 1;
+int detectable_ar = 0;
 
 char *geom = NULL;
 
@@ -158,6 +159,11 @@
        {
          have_to_start_as_daemon = 0;
        }
+      else if (strcmp (argv[i], "-sd") == 0 
+              || strcmp (argv[i], "--detectable-ar") == 0)
+       {
+         detectable_ar = 1;
+       }
       else
        {
          show_help ();
--- xbindkeys.c~        2010-12-05 20:08:48.000000000 +0300
+++ xbindkeys.c 2012-05-11 00:43:32.000000000 +0400
@@ -36,6 +36,7 @@
 #include <libguile.h>
 #endif
 
+#include <X11/XKBlib.h>
 
 
 void end_it_all (Display * d);
@@ -91,6 +92,17 @@
   d = start (display_name);
   current_display = d;
 
+  if (detectable_ar)
+    {
+      Bool supported_rtrn;
+      XkbSetDetectableAutoRepeat(d, True, &supported_rtrn);
+
+      if (!supported_rtrn) 
+       {
+         fprintf (stderr, "Could not set detectable autorepeat\n");
+       }
+    }
+
   get_offending_modifiers (d);
 
   if (have_to_get_binding)
============================================================

--
wbr, Dmitry



reply via email to

[Prev in Thread] Current Thread [Next in Thread]