Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I just got a logitech t400 mouse and everything is working well, except I want to remap the "top" part of the middle mouse to actual middle mouse function.

When I run xev, and capture the clicks, all the mouse buttons return a ButtonPress/ButtonRelease event but the top part of the middle button returns a KeyPress/KeyRelease event as :

KeyPress event, serial 35, synthetic NO, window 0x5200001,
root 0x31d, subw 0x0, time 630089839, (80,128), root:(2871,588),
state 0x10, keycode 133 (keysym 0x31d, (no name)), same_screen YES,
XLookupString gives 0 bytes: 
XmbLookupString gives 0 bytes: 
XFilterEvent returns: False

KeyRelease event, serial 36, synthetic NO, window 0x5200001,
root 0x31d, subw 0x0, time 630089983, (80,128), root:(2871,588),
state 0x50, keycode 133 (keysym 0x31d, (no name)), same_screen YES,
XLookupString gives 0 bytes: 
XFilterEvent returns: False

The bottom part of the middle button works fine, and returns :

ButtonPress event, serial 37, synthetic NO, window 0x5200001,
root 0x31d, subw 0x0, time 630137726, (10,171), root:(2801,631),
state 0x10, button 2, same_screen YES

ButtonRelease event, serial 37, synthetic NO, window 0x5200001,
root 0x31d, subw 0x0, time 630138960, (10,171), root:(2801,631),
state 0x210, button 2, same_screen YES

I would like the remap the top part the same way as the bottom part, is this possible with xmodmap ?

thanks!

share|improve this question

1 Answer 1

up vote 1 down vote accepted

I’ve tried this as well, and eventually found – buried deep in the docs – that this is not possible.

This forum post contains C code that uses the XSendEvent function to emulate a button press. You could start it using xbindkeys, for example.

The forum thread also suggests to use xdotool. Disclaimer: I’ve not tried it yet.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.