You are not logged in.
Pages: 1
Hello everyone,
Recently I got myself a Logitech MX Master. Besides the normal stuff the mouse is equipped with a thumb button, a horizontal scrollbar and buttons for forward/backward.
Everything works fine out of the box, however the thumb button reacts kind of weird. Here is how it functions on Windows and MacOSX (supported by Logitech):
- Pressing it freezes the mouse cursor movement
- Simply pressing and releasing it triggers TriggerA (configurable by some software by logitech)
- Holding it and moving the mouse north triggers TriggerB
- Holding it and moving the mouse south triggers TriggerC
- Holding it and moving the mouse left triggers TriggerD
- Holding it and moving the mouse right triggers TriggerE
So since no there is no Linux support I looked up what it fires with evtest: http://ix.io/jxD
As you can see it triggers KEY_LEFTCTRL, KEY_LEFTALT, KEY_TAB, KEY_TAB, KEY_LEFTALT, KEY_LEFTCTRL when I press it and nothing when I move or release it.
An xinput test reveals that it presses and releases the keys directly on press: http://ix.io/jxF
So I tried to map the button using BTNX like I always did in the past years, and it recognized 3 buttons on press, rawcodes 0x0100001d, 0x01000038 and 0x0100000f.
When I map 0x0100001d it triggers the key after the keys listed by evtest, the other two simply never get triggered.
Other tools like chromium register the buttons as KEY_LEFTCTRL + the last triggered key.
Any idea how I can get this button to work properly, at least for one trigger?
Best regards
PS: Can Xbindkeys be linked to a specific device (the MX Master, in this case)?
Last edited by hashworks (2015-07-07 17:42:32)
Offline
I've just bought this mouse, great hardware!
Have you made any progress concerning the thumb button yet?
Offline
Sadly no!
Offline
Hi, fortunatelly I had some success configuring the mx master thumb button. I'm using xbindkeys and xte (part of the xautomation package) for this, it's a great tool for reconfiguring key bindings.
My finding was that the MX Master thumb button does not emit a specific button press event. It however triggers a series of Control + Alt + Tab combinations. Some of seem to change with every keypress slightly (like in which order the keys are pressed, some times a lonely Left-Control press comes before the actual combination etc ...). We can use that to trigger a command when the thumb button is pressed.
My xbindkeys config looks like this:
######################
# MX Master Settings #
######################
# thumb wheel down => previous tab
"xte 'keydown Control_L' 'key Page_Down' 'keyup Control_L'"
b:6
# thumb wheel up => next tab
"xte 'keydown Control_L' 'key Page_Up' 'keyup Control_L'"
b:7
# backward button => close tab
"xte 'keydown Control_L' 'key w' 'keyup Control_L'"
b:8
# forward button => close tab
"xte 'keydown Control_L' 'key w' 'keyup Control_L'"
b:9
# thumb button => go back in history
# We need a sleep here since the button triggers a few more key codes (wtf?).
# It also triggers Control+Mod2+Control_L and Alt+Mod2+Alt_L. The sleep
# prevents that X receives those keypresses simultaniously. Therefore they
# might interfere and trigger unwanted actions. By the sleep we make sure that
# the Alt+Left is receive as distinct event.
"sleep 0.1 && xte 'keydown Alt_L' 'key Left' 'keyup Alt_L'"
Control+Alt+Mod2 + Tab
I have the side wheel mapped to Ctrl+PageUp and Ctrl+PageDown so that I can scroll through the tabs of the active window. The back/forward buttons (on the side) are both mapped to Ctrl-W (for closing the current tab). I don't find these buttons very easy to distinguish so I mapped them to the same action.
The thumb button is mapped to Alt+Left which will go back in history in the browser. The important bit here is that we have the "sleep 0.1" before the actual key trigger made by xte. Otherwise the active keys triggered by the thumb button will interfere with the actual binding we want to use. The 0.1 is reasonably slow so that the keys bindings won't colide, but reasonably fast that it still feels instant.
Using that method will ofcourse make it impossible to use an actual action for pressing Control+Alt+Tab on the keyboard. But I didn't use that combination anyways, so it was a good solution for me.
Good luck in trying this out
Offline
Thanks for your help gregmuellegger, it's working great!
I'm using the keys to control my music, Volume Up/Down, Track Play/Pause Next/Previous:
######################
# MX Master Settings #
######################
# thumb wheel up => increase volume
"amixer -c 1 set Master 4+"
b:6
# thumb wheel down => lower volume
"amixer -c 1 set Master 4-"
b:7
# backward button => previous song
"xte 'key XF86AudioPrev'"
b:8
# forward button => next song
"xte 'key XF86AudioNext'"
b:9
# thumb button => go back in history
# We need a sleep here since the button triggers a few more key codes (wtf?).
# It also triggers Control+Mod2+Control_L and Alt+Mod2+Alt_L. The sleep
# prevents that X receives those keypresses simultaniously. Therefore they
# might interfere and trigger unwanted actions. By the sleep we make sure that
# the Alt+Left is receive as distinct event.
"sleep 0.1 && xte 'key XF86AudioPlay'"
m:0xc + c:23
Offline
Apologies for the necro, I came across this post today and I've recreated almost the same .xbindkeysrc. I've since noticed when using the thumb button that the action only triggers once (I have it set to toggle mute), and once it's fired once it won't fire again until xbindkeys has been killed and restarted. Have you experienced the same thing at all?
Edit: Turns out in Gnome there is a keyboard shortcut for "Switch system controls" that defaults to Ctrl+Alt+Tab that interferes with the event in xbindkeys. Changing the keyboard shortcut lets xbindkeys function properly.
Last edited by matmunn14 (2015-12-11 21:44:28)
Offline
Sorry for the bump, but since there's no solution yet and this is the best Arch-related match in Google...
I guess nobody has figured out if there's a way to change the thumb button so that it works just like any other mouse button? I have my media keys stacked, so on my old MX Revolution I would hold the thumb button then use the left button for play/pause, wheel for volume up/down, thumb wheel for next/prev song, etc, etc. It's not that practical using one of the buttons next to the horizontal scroll wheel on the MX Master for this, but if I could just hold the thumb button to switch the rest of the mouse over into media control mode, that'd be perfect!
Offline
@gregmuellegger:
Thanks for your code.
But only one - it works, but without pressing a thumb button. Great stuff - side roll can now flip tabs, bad for buttons: undo and the next.
Offline
Sorry for the necrobump too. I'd really really like to map thumb button in order to move or resize Plasma windows. Did anyone succeed in doing that?
Offline
Sorry for the necrobump too.
I'd really really like to map thumb button in order to move or resize Plasma windows. Did anyone succeed in doing that?
Unfortunately, it is not possible. You want thumb button to act just like alt button (so you want to move windows with thumb + left button and resize windows with thumb + right button). You can remap ctrl+alt+tab to alt individually for MX Master virtual keyboard. But there are two issues:
1) ctrl+alt+tab event is sent only after release of thumb button. After thumb releasing, mx master sends six events (3 buttons, press and release for each).
2) Mouse pointer is blocked while thumb is pressed. This was designed such way for gestures recognition. Before releasing, you cannot move mouse pointer.
I guess nobody has figured out if there's a way to change the thumb button so that it works just like any other mouse button? I have my media keys stacked, so on my old MX Revolution I would hold the thumb button then use the left button for play/pause, wheel for volume up/down, thumb wheel for next/prev song, etc, etc. If I could just hold the thumb button to switch the rest of the mouse over into media control mode, that'd be perfect!
I think it is possible, but with some inconvinience. This mouse is registered as two separate input devices: pointer and keyboard. You can see this in xinput list output. Thumb button is acting as pressing ctrl+alt+tab on a keyboard. You can remap ctrl+alt+tab event from MX Master virtual keyboard to act for example as button 10. But it will work only at release, so you need to:
1) press and hold some extra button
2) press and release thumb button
3) release other button
For example, pressing and releasing thumb button exclusively generates events with the following states:
0x10 0x14 0x1c 0x1c 0x1c 0x14
but pressing and releasing thumb button while button 1 is holded generates events with the following states:
0x110 0x114 0x11c 0x11c 0x11c 0x114
I think you can get these states and map them to multimedia key presses.
Offline
I would've closed this thread but since the last post does add nice information to the topic I'm going to keep it open, should any further discussion occur.
In general please don't make it a habit of bumping necros.
Offline
Pages: 1