Page 1 of 1

Logitech MX518 Mouse - How do I bind actions 2 thumb buttons

Posted: Sun Mar 10, 2013 7:05 pm
by Jeff11
I'm finally have time to play around with the thumb buttons on my Logitech MX518 mouse again and I want to try to do two different things.

First, how can I bind the multiple left clicks (at least 3 and as many as 9) to one of my Logitech 518's extra buttons? Say one of the two thumb buttons?

Second, I would like to use the other of the 518's two thumb buttons to bring up a context menu that launches apps (like the desktop context menu) so that I can launch the context menu while I'm in an application window (like a browser).

If I can do either or even better both without messing with the left click it would be great!

Can I just edit the mouse config file or something? (and where would that be?)

Thanks in advance!

Jeff

Re: Logitech MX518 Mouse - How do I bind actions 2 thumb but

Posted: Mon Mar 11, 2013 7:22 pm
by thunder422
I have the exact same mouse and wanted to do something very similar. For years when I was a Windows user, it was very easy to configure the buttons using the Logitech mouse driver. I always set the thumb button to do the Enter key, which I find very convenient for answering dialog boxes without having to move the mouse to the default button (like the OK button). This took some figuring to get working on KDE.

First you need to install some packages if they are not already installed, which are xbindkeys and xautomation. There is another command that is useful for determining the IDs of the buttons on the mouse, but I don't remember what it was. To configure the buttons, add commands to the .xbindkeysrc file in your home directory.

As I said, I hooked Enter for one of my thumb buttons and Control+F12 to the task list button (Control+F12 shows the widgets on the desktop). Here are the commands I added to .xbindkeysrc:

Code: Select all

"xte 'key KP_Escape'"
 b:8

"xte 'keydown Control_R' 'key F12' 'keyup Control_R'"
 b:10
Note the space in front of the "b" (don't know if its necessary). The Control_R stands for the right control key, so Control_L would probably work here also. The "b:" is the button number of the mouse. The command I can't remember is helpful in determining these numbers (start the program and hit a mouse button and its number is displayed). The "b:8" button is the big thumb button and "b:9" is the smaller one (which I don't have configured at the moment). The man pages for these commands (xbindkeys and xte) may also be helpful.

Re: Logitech MX518 Mouse - How do I bind actions 2 thumb but

Posted: Tue Mar 12, 2013 11:36 pm
by Jeff11
Thank you Thunder422 I'm going to see if I can get it working.

Jeff

Re: Logitech MX518 Mouse - How do I bind actions 2 thumb but

Posted: Thu Mar 14, 2013 10:09 pm
by Jeff11
thunder422 wrote:I have the exact same mouse and wanted to do something very similar. For years when I was a Windows user, it was very easy to configure the buttons using the Logitech mouse driver. I always set the thumb button to do the Enter key, which I find very convenient for answering dialog boxes without having to move the mouse to the default button (like the OK button). This took some figuring to get working on KDE.

First you need to install some packages if they are not already installed, which are xbindkeys and xautomation. There is another command that is useful for determining the IDs of the buttons on the mouse, but I don't remember what it was. To configure the buttons, add commands to the .xbindkeysrc file in your home directory.

As I said, I hooked Enter for one of my thumb buttons and Control+F12 to the task list button (Control+F12 shows the widgets on the desktop). Here are the commands I added to .xbindkeysrc:

Code: Select all

"xte 'key KP_Escape'"
 b:8

"xte 'keydown Control_R' 'key F12' 'keyup Control_R'"
 b:10
Note the space in front of the "b" (don't know if its necessary). The Control_R stands for the right control key, so Control_L would probably work here also. The "b:" is the button number of the mouse. The command I can't remember is helpful in determining these numbers (start the program and hit a mouse button and its number is displayed). The "b:8" button is the big thumb button and "b:9" is the smaller one (which I don't have configured at the moment). The man pages for these commands (xbindkeys and xte) may also be helpful.

Hi Thunder,
I was looking at this briefly and am still a bit confused about the coding. Would you be able to show me the complete section of your xbindkeys.src file that describes the mouse?

Thanks,

Jeff

Re: Logitech MX518 Mouse - How do I bind actions 2 thumb but

Posted: Sat Mar 16, 2013 4:43 pm
by Jeff11
Hi Thunder,

That tip helped. Now does anyone know what command I would use to have one of the thumb buttons launch the application menu?

Thanks in advance.

Jeff

Re: Logitech MX518 Mouse - How do I bind actions 2 thumb but

Posted: Sun Mar 17, 2013 1:14 pm
by thunder422
I'm not sure what you mean by the Application Menu. Is this the launcher menu, in other words, the equivalent of the Windows Start button in the lower left corner? If it this what you are talking about, it can be activated with the Alt+F1 key, so that would by the key to put in to .xbindkeysrc:

Code: Select all

"xte 'keydown Alt_L' 'key F1' 'keyup Alt_L'"
 b:<X>
Most functions have a keyboard equivalent or can have one assigned. To find out, start System Settings, go to Shortcuts and Gestures (on the first line under Common Appearance and Behavior). Look under the Standard Keyboard Shortcuts for the common keys and Global Keyboard Shortcuts for more specific keys. (There is a search feature.) I found the Alt+F1 under the KDE component "Plasma Desktop Shell". If there is no key currently assigned to an item you want to use, then assign one and use that key in .xbindkeysrc.

By the way, the so called Meta key is the Windows key on modern keyboards. By default, this key does not work with KDE. I found to activate it, the Keyboard model needs to be changed from "Generic | Generic 101-key PC" in System Settings, Input Devices (under Hardware), Keyboard on the Hardware tab to at least the "Generic | Generic 104-key PC" setting. I use the "Generic | Super Power Multimedia Keyboard" setting because my keyboard (Razer BlackWidow Stealth Edition) also has mutlimedia keys (volume, play/pause, etc.) and now these keys actually work (now if I could figure how to use the M1-M5 macro keys...).

Re: Logitech MX518 Mouse - How do I bind actions 2 thumb but

Posted: Sun Mar 17, 2013 6:38 pm
by Jeff11
thunder422 wrote:I'm not sure what you mean by the Application Menu. Is this the launcher menu, in other words, the equivalent of the Windows Start button in the lower left corner? If it this what you are talking about, it can be activated with the Alt+F1 key, so that would by the key to put in to .xbindkeysrc:

Code: Select all

"xte 'keydown Alt_L' 'key F1' 'keyup Alt_L'"
 b:<X>
Most functions have a keyboard equivalent or can have one assigned. To find out, start System Settings, go to Shortcuts and Gestures (on the first line under Common Appearance and Behavior). Look under the Standard Keyboard Shortcuts for the common keys and Global Keyboard Shortcuts for more specific keys. (There is a search feature.) I found the Alt+F1 under the KDE component "Plasma Desktop Shell". If there is no key currently assigned to an item you want to use, then assign one and use that key in .xbindkeysrc.

By the way, the so called Meta key is the Windows key on modern keyboards. By default, this key does not work with KDE. I found to activate it, the Keyboard model needs to be changed from "Generic | Generic 101-key PC" in System Settings, Input Devices (under Hardware), Keyboard on the Hardware tab to at least the "Generic | Generic 104-key PC" setting. I use the "Generic | Super Power Multimedia Keyboard" setting because my keyboard (Razer BlackWidow Stealth Edition) also has mutlimedia keys (volume, play/pause, etc.) and now these keys actually work (now if I could figure how to use the M1-M5 macro keys...).
Thank you Thunder!
Very helpful so far.
I did get the standard launcher using your Alt+F1 command but I am using the legacy(?) version (just a list with) and that is the one I really want. I have it set that way in my mouse (desktop) right click context menu but can't figure out what the command is to attach it to the thumb button so it will work in any application window.
That's what I'm really looking for if you have some idea. I'm going to look at the shortcuts area next though.
Thanks,
Jeff

Re: Logitech MX518 Mouse - How do I bind actions 2 thumb but

Posted: Sun Mar 17, 2013 8:59 pm
by thunder422
I see. You have the launcher setup in Classic Menu Style instead of Application Launcher Style. You can switch this by right-clicking the launcher button and selected the Switch to... option. I actually prefer the newer Application Launcher style, but I understand many are not a fan of it. The Alt+F1 key brings up the menu with either style.

I also understand you changed the desktop context menu to the Application Launcher from the Standard Menu, which is really like the Classic Menu Style (poor choice in naming I guess). And if I understand you correctly, you want this menu to pop up whenever you hit the thumb button. I'm not sure that is possible.

I know you can get it to pop up from the keyboard, but not easily. The Desktop must have focus and I think the only way to do that is to "Include desktop" for the task switcher (System Settings, Window Behavior, Task Switcher, Main tab). Then use Alt+Tab and select Show Desktop. Then use the context menu key (usually between the right Windows or Meta key and Ctrl key, but not all keyboards have this key). If another window has focus, then its context menu will appear.

By the way, I found that the command I couldn't remember to use to determine mouse button numbers is xev.

Re: Logitech MX518 Mouse - How do I bind actions 2 thumb but

Posted: Sun Mar 17, 2013 9:56 pm
by Jeff11
Hi Thunder,
I managed to get thumb button 8 to launch the "run command" app and launch it right at the mouse pointer (which is good at least for now) and thumb button 9 launches the classic application menu list but it does it by raising if from the menu bar at the bottom of the screen. That isn't ideal but at least I can launch both of those items inside of any application window (which is very handy) :) .
So I'm fairly close to where I want to be. I also know how to edit the key bindings with xbindkeys much better now as a result too.
Thanks for all your help. :D
Jeff