Remapping Buttons With Keystrokes on Logitech M720 Mouse

Ubuntu 24.04 LTS and Logitech M720 Mouse. I’ve tried several options to try to remap the mouse buttons, and read several help forum threads, but none seem to have found a solution for this particular mouse. I’m wondering if anyone here has succeeded.

I’ve tried Solaar and xbindkeys without success. Piper seems particularly promising in that it recognizes the mouse, and will remap with pre-defined functions (e.g. “back”), but trying to do a key combination (e.g. Ctrl-W) gives an error message.

Either a solution to the Piper issue, or another solution entirely that works with the M720 would be appreciated.

For simple button re-mapping you can use xinput

Find the ID your mouse with xinput --list … then you can use --get-button-map and --set-button-map to re-arrange them …
(i.e. if your mouse has ID=6)

xinput --get-button-map 6
1 2 3 4 5 6 7 8 9 10
xinput --set-button-map 6 3 2 1

you could dump that into a script with:

echo "xinput --set-button-map 6 3 2 1" > mouseremap.sh

and create an autostart entry for this script …

For other mapping like i.e. actions you might need a bit more, but with Wayland pretty much everything works through xinput nowadays, so I’d read up on that a little …

xinput doesn’t show the mouse, whether connected via BT or the Logitech Unified Receiver.

Hmm, are you running it from within a terminal in the running session ? It clearly should show all input devices it knows about, regardless of how they are connected …

Yes. I installed libinput and it does show it.

1 Like

Nevermind. I managed to totally brick the Ubuntu system, it only boots to a command line now. I’ve been afraid of this from the beginning, not knowing enough about Ubuntu to effectively troubleshoot, particularly when the whole system goes down.

I enjoy Ubuntu, and have been using it for several months. But I’m just going to go back to Windows, which I understand fully, and which is better supported (e.g. Logitech has software for Windows to do what I want). Fortunately my main computer is fast enough to run Windows. I was using Ubuntu on a computer that wasn’t.

Well, the good thing about Ubuntu is that you can usually repair it in 90% of the cases (it’s usually a matter of you finding it worth to invest your time into this though), so if you decide to try, feel free to ask here, the community can surely give you a hand and help …

1 Like

While it may seem hopeless, it usually is not.

I cannot even recount how many times I messed things up and had to reinstall.

Granted, sometimes I did it purposely to see whether or not I could repair the mess I created.

On most hardware, you can have Ubuntu reinstalled in about 20 minutes.

I do not know the mouse you are using, but it might be an idea to check if it will work with one of the flavours, Xubuntu for example.

As @ogra already said, we are here to help.

Thanks. There just isn’t enough upside to even equal having to restore my Thunderbird email settings if I were to reinstall. I clearly chose the wrong backup app–the one with gpg extensions. I thought that would be my savior if I screwed something up.

I still have another Ubuntu machine, but I use it for very limited purposes. I was going to try starting to run Moneyspire (Quicken alternative) on it, but I’ll give that idea up now.

Thanks, and FYI I’m pretty sure it’s nothing you advised that got me here.

This topic was automatically closed after 30 days. New replies are no longer allowed.