[SOLVED] Mouse thumb button to show Scale mode

Please post suggestions for improvement of Cinnamon on:
https://github.com/linuxmint/Cinnamon
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
coypus

[SOLVED] Mouse thumb button to show Scale mode

Post by coypus »

Hello all

I have a Logitech mouse (like many of you I suspect) which has a bottom thumb button (in addition to to forward/backward thumb rocker buttons). In Windows this button can be used to open an "open window view", much like Scale mode in Cinnamon, which is a feature I quite like and have been trying quite hard to get this working in Mint too, so far unsuccessfully.

Some details:
Mint 17.2 Cinnamon 64-bit, everything up-to-date, pretty much a standard installation
All other mouse button work as expected (mouse buttons 1-9 do what I'd expect, the thumb button is id:10)

After some Internet searches I tried a combination of xbindkeys and xdotool (and also xte from xautomation instead of xdotool).

Worked:
- "xdotool key control+alt+Down" from terminal triggers Scale mode
- thumb button id:10 click is recognised, confirmed with xev
- xbindkey bound to button 10 and triggers gnome-terminal to open, works

Doesn't work:
- putting it all together, i.e. using xbindkeys on Button 10 to run "xdotool key control+alt+Down". Using xbindkey debug/verbose mode I see that the xdotool command is triggered, it's just that it doesn't trigger the global keyboard shortcut to open Scale mode in Cinnamon. Nothing happens. Trying to trigger any other global keyboard shortcut also doesn't work. However using the same method to trigger the execution of any program or even triggering xdotool to type some text, e.g. in a text editor, all work fine.

It's as if the x input generated by xdotool doesn't reach the global keyboard shortcut handler in Cinnamon, but only when triggered by xbindkeys. As I said earlier, doing the same from a terminal works fine. This has got me really stumped.

I tried the same using xte instead of xdotool, but since they both use the same XTEST extension it's no surprise that this doesn't make any difference.

Any ideas?

Thanks
C.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Cosmo.
Level 24
Level 24
Posts: 22968
Joined: Sat Dec 06, 2014 7:34 am

Re: Mouse thumb button to show Scale mode

Post by Cosmo. »

I use this for this button (most likely a similar mouse), in my case for copying selected text:

Code: Select all

"xte 'keydown Control_L' 'key c' 'keyup Control_L'"
   b:10
entered in the file .xbindkeysrc in the home folder.

Try it to find out, if it works in general. After that you might replace the first line for your needs.
coypus

Re: Mouse thumb button to show Scale mode

Post by coypus »

Hi Cosmo

Thanks for responding.

I tried your suggestion and that works fine. It seems that it's only the global keyboard shortcut handler in Cinnamon (defined in System Settings -> Keyboard -> Shortcuts) that is not triggered when using xte or xdotool when executed by xbindkeys.

Just to be clear, the line which doesn't do anything in .xbindkeys is:

Code: Select all

"xdotool key control+alt+Down"
b:10
However,

Code: Select all

xdotool key control+alt+Down
alone in the terminal works fine.

Weird.

Thanks
C.
Last edited by coypus on Sun Sep 06, 2015 4:59 am, edited 2 times in total.
Cosmo.
Level 24
Level 24
Posts: 22968
Joined: Sat Dec 06, 2014 7:34 am

Re: Mouse thumb button to show Scale mode

Post by Cosmo. »

Did you try:

Code: Select all

"xte 'keydown Control_L' 'keydown Alt_L' 'key Down' 'keyup Alt_L' 'keyup Control_L'"
   b:10
Not tested.

Sometimes it is necessary to add to the second line +Release (so it would read: b:10+Release)
coypus

Re: Mouse thumb button to show Scale mode

Post by coypus »

Amazing.

This works:

Code: Select all

"xte 'keydown Control_L' 'keydown Alt_L' 'key Down' 'keyup Alt_L' 'keyup Control_L'"
b:10 + Release
But that is the only combination that works. It doesn't work using xdotool and it also doesn't work without the +Release. Strange behaviour IMO but at least it working now.

Thanks Cosmo!
Locked

Return to “Cinnamon”