Remapping buttons if you're running Wayland could be done like this:
Run xev | grep button to log mouse click events and get the number of the event by f.e clicking in the window. In my case, middle button is:
state 0x10, button 2, same_screen YES
and I want to map it on:
state 0x10, button 13, same_screen YES
Then run xinput --list and find your pointer device, mine is:
Logitech Performance MX id=9 [slave pointer (2)]
xinput get-button-map 9 returns:
1 2 3 4 ... 20
xinput set-button-map:
$ xinput set-button-map 9 1 13 3 4 .. 12 2 14 .. 20
NOTE: replace the number 9 for the number returned by id=
And if that key's behavior is defined, your event is mapped. If it is not, that's a little bit different issue. Under Wayland TBH I haven't found a way for executing a command on an event (which is pretty easy with Xorg's xbindkeys) and therefore fully customizing behavior of key and mouse event.. I believe Wayland is trying to be more secure and disables this behavior.
In any case, you still have the opportunity to switch to Xorg pretty easily and enjoy the functionality.