3

I am using a HP NK527AA Wireless mouse with two side buttons. His mouse wheel is half broken: I can scroll but I can't click it.

In windows I configured the side buttons as 3rd mouse button but unfortunately the only available drivers are for windows. Ubuntu treats the side-buttons as back\forward buttons and it's really annoying.

Is there a way to configure the buttons if though the is no driver?

2 Answers 2

3

There are several ways to control mouse buttons. I am going to use xbindkeys (because I know how)

sudo apt-get install xbindkeys

Now, before we can use xbindkeys we need to create its configuration file

xbindkeys --defaults > $HOME/.xbindkeysrc

Now we need to figure out what the number of the mouse button we want to map is. We do this with a program called xev

xev

When we run xev a small windows will appear. Put your mouse in that window and click the button you want to map. After you press the button several times you should be getting output like:

ButtonRelease event, serial 41, synthetic NO, window 0x4400001, root 0x2e9, subw 0x4400002, time 21579213, (28,34), root:(818,86), state 0x110, button 1, same_screen YES

In this example 'button 1' is the button we want to map.

<screeshot xevTut>

After we have the name of the button we have two options:

You can map the button to a keyboard shortcut

Or you can map the button to launch an application

To Launch an application:

We need to edit the xbindkeys configuration file:

gedit $HOME/.xbindkeysrc

This will open the xbindkeys configuration file in gedit. (note: If you use another text editor, like kate, substitute 'gedit' for 'kate')

Scroll to the bottom of the file and create a new line. If you want 'button 1' to open, say, firefox type:

“firefox”  
b:1  

enter image description here

This will map application 'firefox' to 'button 1'.

To Execute a keyboard shortcut:

We need another application called xte.

sudo apt-get install xautomation

Now we need to edit the xbindkeys configuration file:

gedit $HOME/.xbindkeysrc

Scroll to the bottom of the file and create a new line. To map 'button 1' to a keyboard shortcut, say, Ctrl+C type:

“xte 'key Ctrl_C' “   
b:1

Restart the computer.

0

Easystroke is also a viable option, easy to configure also.

sudo apt-get install easystroke

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .