0

I use xbindkeys to map some mouse buttons with keys.

However, when I change the keyboard layout, xbindkeys does not simulate some assigned keys on the new layout. When I change to the previous layout, it works fine.

The combinations that stop working are:

# Present desktops
"xte  'key Super_L'"
  b:10 + release

# Zoom
"xte 'keydown Super_L' 'keydown Alt_L' 'key 8' 'keyup Super_L' 'keyup Alt_L'"
  b:13 + release

All that keys are in the same place on the two different layouts.

I checked with xbindkeys -n -v and it is still recognizing the mouse buttons, but xbindkeys does not trigger the associated keys.

With the en layout:

Button release !
e.xbutton.button=10
e.xbutton.state=16
"xte  'key Super_L'"
    Release + m:0x0 + b:10   (mouse)
got screen 0 for window d3
Start program with fork+exec call

After changing to the es layout:

Button press !
e.xbutton.button=10
e.xbutton.state=16
Button release !
e.xbutton.button=10
e.xbutton.state=8208

1 Answer 1

0

This is a bug in xbindkeys. You need to download latest source (1.8.6) and apply patch (fix_layout.patch). Bug discussed here.

fix_layout.patch

From d4a943caa3d700a5edb18d5ab528e8cf7f6d54c9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alberto=20S=E1nchez=20Molero?= <[email protected]>
Date: Mon, 10 Feb 2014 21:11:05 +0100
Subject: Fix keyboard layout problems - Ignore 13th and 14th bits of button
 state

Author:    Alberto Sanchez Molero <[email protected]>
---
 xbindkeys.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xbindkeys.c b/xbindkeys.c
index b0adef9..5b1b86b 100644
--- a/xbindkeys.c
+++ b/xbindkeys.c
@@ -377,7 +377,7 @@ event_loop (Display * d)
          printf ("e.xbutton.state=%d\n", e.xbutton.state);
        }

-     e.xbutton.state &= ~(numlock_mask | capslock_mask | scrolllock_mask
+     e.xbutton.state &= 0x1FFF & ~(numlock_mask | capslock_mask | scrolllock_mask
                   | Button1Mask | Button2Mask | Button3Mask
                   | Button4Mask | Button5Mask);

@@ -409,7 +409,7 @@ event_loop (Display * d)
          printf ("e.xbutton.state=%d\n", e.xbutton.state);
        }

-     e.xbutton.state &= ~(numlock_mask | capslock_mask | scrolllock_mask
+     e.xbutton.state &= 0x1FFF & ~(numlock_mask | capslock_mask | scrolllock_mask
                   | Button1Mask | Button2Mask | Button3Mask
                   | Button4Mask | Button5Mask);

-- 
cgit v1.0
1
  • Thanks. It is also possible (and probably better) to clone the repository and compile the last version (with the last improvements)
    – Manuel
    Sep 17, 2016 at 18:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .