Score:2

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

in flag

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.

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

vanadium avatar
cn flag
You are assuming you need to specify the mouse buttin in `dconf`? Please avoid the traps of an XY question (https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem) : this distracts valuable resources of people willing to help. Also provide specific information about what you tried.
in flag
I get what you are stating. I tweaked the question a little.
in flag
I can’t believe nobody knows the syntax, nor have I been successful in finding it on the web. Baffling.
in flag
I think the question is precise. how do you bind a mouse button in Dconf? what more is there to ask?
Score:2

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?
in flag
the latest version of Ubuntu use wayland and xdotool (as far as I know) does not work. I used to do it this way.
sancho.s ReinstateMonicaCellio avatar
@kdubs - I suggest: 1) Post the exact version of Ubuntu you have, and any other detail that may impact on the answer. 2) Try the solution with xdotool. It takes less than 4 minutes. 3) Try the solution with xautomation.
in flag
I have tried the xdotool solution. that's how had it setup before the update. I'll look into xautomation, but it uses xte and that does not work with wayland.
sancho.s ReinstateMonicaCellio avatar
@kdubs - I posted yet a few other solutions for Wayland. Please take the time to check the few links provided.
in flag
thanks for you effort. these instructions worked : https://yulistic.gitlab.io/2017/12/linux-keymapping-with-udev-hwdb/
sancho.s ReinstateMonicaCellio avatar
@kdubs - Great! You might also check https://unix.stackexchange.com/a/587975/137608 then.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.