Bind mouse button on Fedora 33 wayland

Hi !

I use 4 different mouse/trackball for my workflow on my Windows desktop and I struggle to replicate my config on Fedora 33.

Key detection issue

So the first issues is on my trackball it’s a Elecom Huge ( M-HT1DRBK) the pointer works, as the left click and the right click but the forward/back button don’t do anything, this The trackball is supported by the kernel (hid-elecom.c)

Key mapping & mouse/trackball configuration

Basically i would like to be able to configure of the mouse/trackball independently of each other and for the application that i’m runing. ( swtich to the next virtual desktop on gnome when i press fn2 when the cursor is over the taskbar, them make a combinaison keystroke when virtualbox is use… etc)

So for what i have search xbindkeys don’t work on wayland an i have two possibility :

  • swaynagmode” form “sway” enable the possibility to emulate keyboard shortcut from the mouse.
  • Hawck My best option i guest… but honestly i will prefer a GUI and more “native” solution them write lua script…

Sensibility by device

The last issue is the cursor speed, gnome set the same speed for every devices, and i have to play with DPI button on the different mouse/trackball.

Thanks in advance for reading me :slight_smile:

1 Like

I do use dconfig editor to set trackball org.gnome.desktop.peripherals.trackball (set custom value to 9, you could test that for your desktop)

1 Like

Thanks for the answer :slight_smile:
But they are now speed configuration unlike the mouse section, but at least I can configure the profile.

Ok so i get back with more stuff:

  • Logiops is an unofficial driver for Logitech mice and keyboard.
  • Piper/libratbag is a GTK+ application to configure gaming mice. Piper is merely a graphical frontend to the ratbagd DBus daemon.

Unfortunately Piper don’t support custom macro on my mouse, and support only the two Logitech and not the Coolermaster and the Elecom Huge, and the macro capabilities are quite wick, no macro per application for example…

I haven’t try yet Logiops but it only support a smal list of Logitech device at the moment.

So i’m still using the Windows driver for some on my device on a VM when i work.

UPDATE :slight_smile:

New project found : Key Mapper

Quite a amazing project white GUI, i just paste here the description of the project :

An easy to use tool to change the mapping of your input device buttons.
Supports mice, keyboards, gamepads, X11, Wayland, combined buttons and programmable macros.

It recognize all my devices, keyboard, mouse,trackballs… easy to install, some keys are not detect but the project is quite new (29 Nov 2020 the first release) and have already7 releases.

How can it be installed to Fedora? Compile from source or any repositories available?

I have follow the “pip” installation in the documentation, in my case it was just a one command line job and it was install on fedora 33
But it have some dependency relative to “python3 python3-wheel setuptools pip git” that i have already install.
At my knowledge no repo available for rhel or debian, only for arch but the project is quite new and it can change in next months.

1 Like

Thank you very much, this is my first time to use pip and it installed key-mapper without issues on Fedora33.

I can start up key-mapper-gtk and play with the GUI with

$sudo key-mapper-gtk

I don’t know where to start, I want to map the detected “BTN_EXTRA” and “BTN_SIDE” of my HP mouse to switch workspaces in Gnome. I don’t find which one should be used in the “Mapping” field of the button.

Normally Key-mapper will install a shortcut in the launcher of gnome.

To interact with gnome function, first I make keyboard shortcuts in the setting menu of gnome, like “Ctrl+Page Down” to switch to a lower/next virtual desktop
Then on Key-mapper under “Mapping” column you need to follow the documentation to make the keyboard macro in this example :

m(Control_R,k(key_pagedown))

Then first you save you profile and then hit apply.

It’s not user friendly but it’s quite powerful like this, see the usage documentation for more information about it

And yeah and you need to enable “Autoload” on the save preset and also to enable the service, so it can start at boot:

sudo systemctl enable key-mapper

So far only the auto load part is not working.
(After reboot, I checked systemctl status key-mapper, which is running. After after firing up with sudo key-mapper-gtk, the preset is having “auto load” turned on. But the mappings worked once I clicked apply.)

Thank you very much for introducing this great tools. I will surely follow this project and see if I can do context sensitive mappings, like the same button maps to different actions while in different applications.

1 Like

On the previous version i get this also, but on the 6.0 version the auto load function work fine with multiple devices.
Try to update, check you configuration and auto load function, and also if the service raise any error.

1 Like