You are not logged in.

#1 2020-11-19 20:53:46

Pomegranate
Member
Registered: 2020-10-01
Posts: 7

[Solved] Unable to simulate right mouse button with xte and xbindkeys

Hi, I'm trying to bind button 9 to button 3 on my mouse using xbindkeys. My current ~/.xbindkeysrc looks like this:

"xte 'keydown Control_L' 'keydown v' 'keyup Control_L' 'keyup v'"
        b:6

"xte 'keydown Control_L' 'keydown c' 'keyup Control_L' 'keyup c'"
        b:7

"xte 'key Down'"
        b:8

"xte 'mouseclick 3'"
        b:9

"xte 'key Return'"
        b:10

"xte 'key Escape'"
        b:11

"xte 'key F5'"
        b:12

when I bind a random key to button 9, it works, but with mouseclick 3 bound it doesn't. When I manually run

xte 'mouseclick 3'

it works perfectly, but when I assign it to button 9 it doesn't seem to trigger.
xev or xbindkeys -k don't seem to recognise it when I press the newly-bound button 9. xev does notice, but it doesn't show what key was pressed for some reason:

LeaveNotify event, serial 40, synthetic NO, window 0x7000001,
    root 0x1a3, subw 0x0, time 1851895, (55,172), root:(888,637),
    mode NotifyGrab, detail NotifyAncestor, same_screen YES,
    focus YES, state 0

<normally, the keycode event would be here>

EnterNotify event, serial 40, synthetic NO, window 0x7000001,
    root 0x1a3, subw 0x0, time 1853447, (55,172), root:(888,637),
    mode NotifyUngrab, detail NotifyAncestor, same_screen YES,
    focus YES, state 0

KeymapNotify event, serial 40, synthetic NO, window 0x0,
    keys:  4294967203 0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

Any ideas on why the right mouse button doesn't want to trigger?

Last edited by Pomegranate (2020-11-21 20:20:31)

Offline

#2 2020-11-19 22:15:03

seth
Member
Registered: 2012-09-03
Posts: 17,220

Re: [Solved] Unable to simulate right mouse button with xte and xbindkeys

Errr… why don't you just xmodmap the buttons or use

Option      "ButtonMapping"                             "1 2 9 4 5 6 7 8 9"

Offline

#3 2020-11-21 20:20:11

Pomegranate
Member
Registered: 2020-10-01
Posts: 7

Re: [Solved] Unable to simulate right mouse button with xte and xbindkeys

Thank you, I didn't even know xmodmap was a thing. Still kind of curious why it didn't work with xbindkeys though.

Offline

#4 2020-11-21 21:03:55

seth
Member
Registered: 2012-09-03
Posts: 17,220

Re: [Solved] Unable to simulate right mouse button with xte and xbindkeys

I could imagine that the concurrent button presses (you pressing 9 and xte trying to press 3) fail - you could try to "sleep 0.2; xte …" to give yourself time to release the button, but of course that's now academic smile

Offline

Board footer

Powered by FluxBB