Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

how does one bind mouse button 10 in DCONF when using wayland and xdotool does not work?

I’m using Ubuntu 21.10 with wayland. xdotool does not work with this setup.

I’ve trying to use dconf to bind a function to a mouse button (toggle-overview). I can not find anywhere a list of the valid sequences for keys in dconf.

I’m willing to use an xdotool equivalent, but I’ve yet to see a supported one for Wayland.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I’ve used xev to tell me it’s button 10 that I want to bind, I just don’t know how to tell dconf how to accept button 10.

I tried binding other key sequences (^C for one) just to see if those would work. Those sequences do just fine.

How does one specify a mouse button in dconf?

shown below in a image of the dconf-editor where I’m trying to enter the mouse button, the "mouse10" text. That value doesn’t work. If I replace that with ‘c’ it will then work.

I’m trying to find the correct value to use for "mouse10"

enter image description here

>Solution :

EDIT #2. Solution #3

If Solutions #1,2 below don’t work for you, because you have Wayland or else, you may try with Key Mapper GUI (ref, ref) (note this was one of the Related links I have previously posted at the bottom),
or mouse-bind with evemu,
or wayland-mouse-mapper (patch) also with evemu.

See summary here.
I didn’t have time to test it myself, but I have read many reports that it works, and again it is very simple.

Related:

  1. https://www.reddit.com/r/linux4noobs/comments/fih5aw/how_to_change_or_assign_the_mouse_buttons_in/

EDIT #1. Solution #2

If Solution #1 below doesn’t work for you, you may try with xautomation (ref, ref).
I didn’t have time to test it myself, but I have read many reports that it works, and it is as simple as xdotool.


Solution #1

I don’t know why you want to force the mouse button binding via dconf.
I don’t even know if that is possible.
The dconf menu you quote is for binding keys to actions, not mouse buttons to either keys or actions.

The "canonical" method for what you want to achieve (although not via dconf) is very simple, via xdotool.

  1. Install with

     $ sudo apt install xbindkeys x11-utils xdotool
    
  2. Create a basic .xbindkeysrc

     $ xbindkeys -d > ~/.xbindkeysrc
    
  3. Edit ~/.xbindkeysrc, appending

     "xdotool key 'Super'"
            b:10
    
  4. Start with

     $ xbindkeys
    

I have just tested and it works.
If you want to recover the behavior of button #10, use killall xbindkeys.


Related:

  1. https://unix.stackexchange.com/questions/199325/what-are-the-differences-between-xdotool-and-xautomation
  2. https://stackoverflow.com/questions/31940669/xdotool-ctrl-key-and-keyboard-layouts
  3. How to bind mouse buttons to keys?
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading