"Present Windows" as mouse button shortcut

Hi!

Can anyone tell me how I can set the top button on my mouse to be a shortcut for the desktop effect “Present Windows”? I have a Logitech MX900 mouse and the button I’m talking about is the one on the top that looks like two overlapping rectangles.
See picture here: ImageBam - Fast, Free Image Hosting and Photo Sharing

Thanks!

I do not know the answer. But I do know what is missing in your post. Please tell which level of openSUSE and which desktop (KDE, Gnome, …) you are using.
I know some people will simply not answer such a question where even this basic info is missing.

Also if you’re using KDE are you using Kwin or Compiz? If you’re using Gnome you’re using Compiz.

Take Care,

Ian

Sorry about the lack of info guys! I’m on KDE 4.4 on OpenSUSE 11.3. I’m using KWin, not compiz, and also the OSS radeon video drivers. Now, any thoughts on how to do it?

Try going to Configure Desktop (Personal Settings)>Desktop Effects>All Effects>Present Windows and click the wrench icon next to it. Down at the bottom is Activation. Here you can set the shortcut for Present Windows. Just choose which Present Windows you want to activate and then choose Custom and then click where it says None and it will change to Input. Click the mouse button you want to use and click ok. Hopefully it uses the mouse button. I tried with the middle mouse button and it wouldn’t accept it. Hopefully your extra button will be accepted.

Take Care,

Ian

Thanks for your response, but that didn’t work. It seems like it only accepts keyboard commands as an option. Any other ideas?

I have mine set to trigger when I move to the lower left corner.

Also you may have to make a xorg.conf file to recognize the non standard mouse buttons. Button maps are tricky.

Hi! I have set mine to trigger at the top left corner, but I was thinking that it wouldn’t be bad to have a mouse button shortcut to it. Maybe it’s to difficult for me to achieve, though… I don’t know much about editing config files etc. I like nice little GUIs for that. Thanks for your help y’all!

I found the config file last night and tried editing it to do something with the middle mouse button but it didn’t work. You can try if you want but you have to figure out what the button press is called when you press that button on your mouse. The config file is at /home/username/.kde4/share/config/kglobalshortcutsrc

Look for the Kwin section and you’re going to want to change one of these three:

Expose=**Ctrl+F9**,Ctrl+F9,Toggle Present Windows (Current desktop)
ExposeAll=**Ctrl+F10**,Ctrl+F10,Toggle Present Windows (All desktops)
ExposeClass=**Ctrl+F7**,Ctrl+F7,Toggle Present Windows (Window class)

The first key combo is where you have to make the change to change the custom key combo.

Take Care,

Ian

If anyone else is interested in seeing this happen in the future, please vote here. It is feature “#310265 “Present Windows” effect as mouse button shortcut” on OpenFATE.
Thanks!

Thanks for your reply! How do I find out what the mouse button press is called so I can try your suggestion?

In general, assigning mouse buttons to actions right now isn’t supported very well (if at all). I have no idea how this technically could be done, nor who might be interested in doing it. I’ll try to mention it in a blog on planet.kde.org, see if any dev is interested…

I think the problem is that some mice have a bunch of extra non standard buttons. And it may be difficult for Xwindows to sort them out. In Windows these rodents require special drivers to use all the non standard features. You can map the buttons in an xorg.conf file but it is really guess work.

Thanks! If you can find someone to make this happen I’ll be a very happy man! :slight_smile:
BTW, congrats on your position as community manager!

There is a way, but it’s a bit complicated…first, you need to have some extra programs installed.

xbindkeys (Index of /repositories/X11:/Utilities/openSUSE_11.3)
xautomation (Index of /repositories/home:/dsbhayangkara/openSUSE_Factory)

Just install those two programs and disable the repos again.

Secondly, you need figure out which mouse-button the button in question is. Your mouse look identical to mine (also a logitech even if not the exact model - MX518 in my case) so chances are the button numbers are the same.

Now we need to create a configuration file. You can use mine as a template:


# Previous desktop
"qdbus org.kde.kwin /KWin org.kde.KWin.previousDesktop"
    b:9

# Next desktop
"qdbus org.kde.kwin /KWin org.kde.KWin.nextDesktop"
    b:8

# Present windows
"xte 'keydown Super_L' 'key F10' 'keyup Super_L'"
    b:10

Save this as /home/username/.xbindkeysrc

Then we need a script in .kde4/Autostart

Save the following script in that folder as say bindkeys:


#!/bin/sh                                                                                                                                                                                                  
xbindkeys &  

make sure it is executable:


chmod u+x /home/username/.kde4/Autostart/bindkeys

Almost there. Enter the Desktop effects settings module, and change the keyboard shortcut to meta (windows key usually) +f10 (since that’s what the config script
wants) for “Toggle present windows (all desktops)”. Apply the changes.

Close all programs and logout and back in again. Now you should be able to use that button to toggle present windows and the two buttons on the side to switch virtual desktop.

Thanks SauronXXX for your help, but that just might be a little overkill to get a mouse button to work. I think I’ll wait and see if it gets easier in the future. Maybe it gets into to KDE as another KCM or something…

I thought so too at first, but once I got it working I soon came to think “How did ever get by without this?” Anyway, yes. It would certainly be much better to have it as a KCM and I hope it will someday.

xbindkeys is very powerful.
Does it have a way to catch double click event but doesn’t affect single click?
I try to toggle Present Windows (Window class) just by double click on right mouse button…It’s very import as it couldd help switch between one application’s several instances if using smooth tasks instead of traditional taskbar.