Hm, I think I somehow advanced...
I replaced xvkbd with xdotool, and voila, it works without sticking keyboard modifiers - but now, the mouse modifiers themselves stick. This only happens after quite some time of usage (hours), but with no discernable reason. It seems that the "release" event is just not caught any more, I outfitted its function with debug output and it doesn't show.
This state cannot be cured, except by an X restart. I at least tried to restart xbindkeys and re-plug the mouse, couldn't think of anything else ^^ (Restarting hald or the like maybe? Didn't want to break my session.)
Here is my output:
Code:
vinter@frostbox:~$ xbindkeys -n -v
displayName = :0.0
rc file = /home/vinter/.xbindkeysrc
rc guile file = /home/vinter/.xbindkeysrc.scm
getting rc guile file /home/vinter/.xbindkeysrc.scm.
initializing guile fns...
min_keycode=8 max_keycode=255 (ie: know keycodes)
xbindkey_wrapper debug: key = b:8
xbindkey_wrapper debug: key = b:9
xbindkey_wrapper debug: key = b:10
xbindkey_wrapper debug: key = b:11
xbindkey_wrapper debug: key = b:12
min_keycode=8 max_keycode=255 (ie: know keycodes)
"(Scheme function)"
m:0x0 + b:8 (mouse)
"(Scheme function)"
m:0x0 + b:9 (mouse)
"(Scheme function)"
m:0x0 + b:10 (mouse)
"(Scheme function)"
m:0x0 + b:11 (mouse)
"(Scheme function)"
m:0x0 + b:12 (mouse)
starting loop...
This is the same for both runs.
Now, the buggy output:
Code:
Button press !
e.xbutton.button=8
e.xbutton.state=16
"(Scheme function)"
m:0x0 + b:8 (mouse)
got screen 0 for window 15a
xbindkey_wrapper debug: key = b:1
xbindkey_wrapper debug: key = b:2
xbindkey_wrapper debug: key = b:3
xbindkey_wrapper debug: key = b:4
xbindkey_wrapper debug: key = b:5
xbindkey_wrapper debug: key = b:9
xbindkey_wrapper debug: key = b:10
xbindkey_wrapper debug: key = b:11
xbindkey_wrapper debug: key = b:12
xbindkey_wrapper debug: modifier = release.
xbindkey_wrapper debug: key = b:8
min_keycode=8 max_keycode=255 (ie: know keycodes)
"(Scheme function)"
m:0x0 + b:1 (mouse)
"(Scheme function)"
m:0x0 + b:2 (mouse)
"(Scheme function)"
m:0x0 + b:3 (mouse)
"(Scheme function)"
m:0x0 + b:4 (mouse)
"(Scheme function)"
m:0x0 + b:5 (mouse)
"(Scheme function)"
m:0x0 + b:9 (mouse)
"(Scheme function)"
m:0x0 + b:10 (mouse)
"(Scheme function)"
m:0x0 + b:11 (mouse)
"(Scheme function)"
m:0x0 + b:12 (mouse)
"(Scheme function)"
Release + m:0x0 + b:8 (mouse)
Button release !
e.xbutton.button=8
e.xbutton.state=8208
^C
The output is simple: It detects that a button was pressed, then tells me twice in different formats what bindings have changed. A button release is detected at the end.
This is the clean output, I removed identical lines:
Code:
Button press !
e.xbutton.button=8
e.xbutton.state=0
[...]
Button release !
e.xbutton.button=8
e.xbutton.state=0
"(Scheme function)"
Release + m:0x0 + b:8 (mouse)
got screen 0 for window 15a
released!
xbindkey_wrapper debug: key = b:8
xbindkey_wrapper debug: key = b:9
xbindkey_wrapper debug: key = b:10
xbindkey_wrapper debug: key = b:11
xbindkey_wrapper debug: key = b:12
min_keycode=8 max_keycode=255 (ie: know keycodes)
"(Scheme function)"
m:0x0 + b:8 (mouse)
"(Scheme function)"
m:0x0 + b:9 (mouse)
"(Scheme function)"
m:0x0 + b:10 (mouse)
"(Scheme function)"
m:0x0 + b:11 (mouse)
"(Scheme function)"
m:0x0 + b:12 (mouse)
^C
As you can see, in this version, my function with the debug output gets called; in the end, the buttons get new bindings.
What strikes me as the main difference is this
Code:
Button press !
e.xbutton.button=8
e.xbutton.state=16
[...]
Button release !
e.xbutton.button=8
e.xbutton.state=8208
(broken) vs this
Code:
Button press !
e.xbutton.button=8
e.xbutton.state=0
[...]
Button release !
e.xbutton.button=8
e.xbutton.state=0
(working). Unfortunately, I could not find out anything about the meaning of e.xbutton.state. Can anyone shed some light on the subject?