This is a static archive of the old Zorin Forum.

The information below may be outdated. Visit the new Zorin Forum here ›

If you have registered on the old forum, you will need to create an account on the new forum.

(SOLVED) Kensington Expert Mouse button mapping help

WMC77

Mon Jul 30, 2012 4:40:27 pm

I use a Kensington Expert Mouse trackball. Due to an injury, I REALLY need to remap the buttons to get Zorin usable, but having a hard time figuring it out. In my perfect world both left buttons will be regular clicks, bottom right click and drag, and top right right click. Or, top left click, bottom left middle click, top right right click, bottom right click and drag. The scroll wheel functionality is a side concern.

I've tried pretty much every tut I've came across in the past few weeks doing searches to the point of having modified and created so many x11, .conf, and imwheel files unsuccessfully that I just reinstalled Zorin yesterday to start over from scratch. I build my own computers and have installed Winders countless times and comfortable even digging into the registry, root and rom my Android phones, poke around bios, etc, but I'm a complete Linux newb. The zen art of the terminal eludes me yet. I'm working on that.

My computer specs are home build with Asus m4a78t-e mobo, AMD 6 core Phenom ll x6 at 3.2 to 4.0 ghz depending on what I'm doing, Asus GeForce GTS 450 video card, 16 gb of Patriot 1333 ram running Winders 7 64 Pro as my primary OS for now. Three 1.5 tb 7,200 rpm hard drives. One with Winders and its files, one strictly a back up, one with Zorin in a 120 gb partition and the rest of the space backing up.

I do a lot of photography and some hd video. Without the mouse functioning as needed I can't physically do even basic editing and manipulation, rendering it useless. I would like to point out that I'm EXTREMELY pleased with how well Zorin natively handles ram and cpu as well as drivers. Within 2 hours yesterday I had Zorin reinstalled, updated, and running my living room center: 73" Mitsubishi tv, Onkyo receiver and 7.1 surround sound via hdmi cable. I had it streaming Immortals 3d in stereoscopic 3d. Impressive! I can't get it to output sound through the hdmi cable to my receiver, but haven't had time to tinker with it other than the basic sound options under system settings

If I lag responding please don't take that as not listening, don't care, or unappreciative. I work 60+ hours a week at my "real" job plus photo on the side. Thanks VERY much for any help or hints!

madvinegar

Mon Jul 30, 2012 4:53:09 pm

Hi.
Try downloading from software center the packages:

"keyboard and mouse"
and
"pointing devices"

Go through their settings and see if you get the results you need.

WMC77

Mon Jul 30, 2012 8:58:59 pm

Thanks, but no luck with those. My mouse is recognized and shows up as "Kensington Expert Mouse"

madvinegar

Mon Jul 30, 2012 9:00:47 pm

I suppose it is a USB mouse. Could you please post the result of
Code:
lsusb

madvinegar

Mon Jul 30, 2012 9:14:01 pm

WMC77

Mon Jul 30, 2012 10:50:16 pm

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 0781:5530 SanDisk Corp. Cruzer
Bus 004 Device 002: ID 046d:c517 Logitech, Inc. LX710 Cordless Desktop Laser
Bus 004 Device 003: ID 047d:1020 Kensington Expert Mouse Trackball

I will try what's in that link soon. I had not seen that one. There are also some other links within the thread which may help. Thanks again.

WMC77

Tue Jul 31, 2012 7:40:24 pm

I still haven't gotten it to work after quite a bit of playing and frustration. I'm sure there's a way using imwheel or xbindkeys. I'm just not smart enough to figure it out.

Currently the buttons are:
Bottom left (button 1) - click
Top left (button 2) - middle click
Bottom right (button 3) - right click
Top right (button 8) - nothing
Scroll wheel turning left - button 4
Scroll wheel turning right - buttfon 5

I'm trying to get it to be:
Bottom left (button 1) - click or middle click
Top left (button 2) - click
Bottom right (button 3) - click and hold/drag. As in click once, it holds. Click again, it releases.
Top right (button 8) - right click

Thanks again!

Wolfman

Tue Jul 31, 2012 7:44:03 pm

Hi,

it may be a case of a "Broken File" somewhere, see this thread about updating in "Recovery Mode" and use the third option in the broken files section.

viewtopic.php?f=5&t=2247

Regards Wolfman

WMC77

Wed Aug 01, 2012 9:49:17 pm

Thanks Wolfman. Did that. I'm not sure if it helped. Couldn't have hurt. It only found about 13kb worth of files to fix.

After more searching and trying than I care to admit, this is where I am at.

I found a small tut here https://wiki.ubuntu.com/X/Config/Input. Close to the middle the author tells how to disable the middle mouse button with xinput. I modified what he did to change the mapping of my buttons.

In a terminal I typed

Code:
xinput


Which spit out

Code:
input
⎡ Virtual core pointer                       id=2   [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                 id=4   [slave  pointer  (2)]
⎜   ↳ Logitech USB Receiver                      id=9   [slave  pointer  (2)]
⎜   ↳ Kensington      Kensington Expert Mouse    id=10   [slave  pointer  (2)]
⎣ Virtual core keyboard                      id=3   [master keyboard (2)]
    ↳ Virtual core XTEST keyboard                id=5   [slave  keyboard (3)]
    ↳ Power Button                               id=6   [slave  keyboard (3)]
    ↳ Power Button                               id=7   [slave  keyboard (3)]
    ↳ Logitech USB Receiver                      id=8   [slave  keyboard (3)]


Giving me the id of my mouse: 10.

Putting in xinput -c spit out

Code:
~$ xinput -config
usage :
   xinput get-feedbacks <device name>
   xinput set-ptr-feedback <device name> <threshold> <num> <denom>
   xinput set-integer-feedback <device name> <feedback id> <value>
   xinput get-button-map <device name>
   xinput set-button-map <device name> <map button 1> [<map button 2> [...]]
   xinput set-pointer <device name> [<x index> <y index>]
   xinput set-mode <device name> ABSOLUTE|RELATIVE
   xinput list [--short || --long || --name-only || --id-only] [<device name>...]
   xinput query-state <device name>
   xinput test [-proximity] <device name>
   xinput create-master <id> [<sendCore (dflt:1)>] [<enable (dflt:1)>]
   xinput remove-master <id> [Floating|AttachToMaster (dflt:Floating)] [<returnPointer>] [<returnKeyboard>]
   xinput reattach <id> <master>
   xinput float <id>
   xinput set-cp <window> <device>
   xinput test-xi2 <device>
   xinput map-to-crtc <device> <crtc name>
   xinput list-props <device> [<device> ...]
   xinput set-int-prop <device> <property> <format (8, 16, 32)> <val> [<val> ...]
   xinput set-float-prop <device> <property> <val> [<val> ...]
   xinput set-atom-prop <device> <property> <val> [<val> ...]
   xinput watch-props <device>
   xinput delete-prop <device> <property>
   xinput set-prop <device> [--type=atom|float|int] [--format=8|16|32] <property> <val> [<val> ...]


From that I figured out to put in

Code:
xinput get-button-map kensington expert mouse


Which told me my button mapping was 1 2 3 4 5 6 7 8 and my mouse id was 10.

According to the tut 1 = left click. 2 = middle click. 3 = right click. 4 = scroll left. 5 = scroll right. The button numbers you input assign one of those to replace wherever they correspond in your regular button mapping order.

So, in the terminal I typed

Code:
~$ xinput set-button-map 10 1 1 3 4 5 6 7 2


And bam, my buttons are now

Bottom left (button 1) = click
Top left (button 2) = click
Scroll wheel (buttons 4 and 5) = Scroll
Bottom right (button 3) = right click
Top right (button 8) = middle click

Now, dumb question, but how do I make it run at start up? As it is now when I boot I must open a terminal and type ~$ xinput set-button-map 10 1 1 3 4 5 6 7 2. Simple enough, but annoying. I tried System tools - Preferences - Startup Applications and putting xinput in, but ummm, showing my linux newbiness I don't know what command file to point to or exactly where to put the ~$ xinput set-button-map 10 1 1 3 4 5 6 7 2 at to tell it to command from. I ASSume in the xorg.config file. But again, where to put it in there?

I would still LOVE and need to turn one button, preferably my bottom right button to a drag button, but can wait on that battle while I savor in my small victory.

Thanks again for any help or pointers.

madvinegar

Thu Aug 02, 2012 6:28:03 am

WMC77 wrote:Now, dumb question, but how do I make it run at start up? As it is now when I boot I must open a terminal and type ~$ xinput set-button-map 10 1 1 3 4 5 6 7 2. Simple enough, but annoying. I tried System tools - Preferences - Startup Applications and putting xinput in, but ummm, showing my linux newbiness I don't know what command file to point to or exactly where to put the ~$ xinput set-button-map 10 1 1 3 4 5 6 7 2 at to tell it to command from. I ASSume in the xorg.config file. But again, where to put it in there?


Try this.
Open terminal and write
Code:
sudo gedit /etc/rc.local


and add the line
xinput set-button-map 10 1 1 3 4 5 6 7 2

just above the last line, i.e. just above "exit".

Save, reboot and let me know if it worked.

Wolfman

Thu Aug 02, 2012 6:32:47 am

Hi,

further to MV's suggestion, I can only suggest a startup command, go into "Startup Applications" > Add > then paste the coomand where it says "Command", give it a name and save, then restart your PC, I think MV's suggestion is better though as I cannot say whether mine would work well if at all!!.

Regards Wolfman :D

madvinegar

Thu Aug 02, 2012 7:04:09 am

WM I believe that your idea is do-able but I think it has to be done as follows:

You open terminal and write
Code:
sudo gedit /home/<yourusername>/kensington_mouse.sh


In the blank document that will open you write the following.
#!/bin/bash
xinput set-button-map 10 1 1 3 4 5 6 7 2
exit 0

You save the file and exit.

You then go to /home/<yourusername> to find the file "kensington_mouse" (you need to press ctrl+H to view it as it will be hidden). You right click on the file>properties>permissions and you tick the box that says "allow executing as a program".
You click ok and exit.

Then you go to startup applications>add and in the command field you navigate to /home/<yourusername>/kensington_mouse.sh

At least this is what I believe, but I really hope that the instructions on my previous post will do the job. :mrgreen:

WMC77

Thu Aug 02, 2012 6:52:25 pm

madvinegar wrote:
WMC77 wrote:Try this.
Open terminal and write
Code:
sudo gedit /etc/rc.local


and add the line
xinput set-button-map 10 1 1 3 4 5 6 7 2

just above the last line, i.e. just above "exit".

Save, reboot and let me know if it worked.

Negative Ghost Rider.

The terminal spits out this:

Image

The file does open though.

Image

There was a zero at the end of exit. I tried multiple times with and witrhout it. Same results. Nothing happened.

WMC77

Thu Aug 02, 2012 7:11:26 pm

madvinegar wrote:WM I believe that your idea is do-able but I think it has to be done as follows:

You open terminal and write
Code:
sudo gedit /home/<yourusername>/kensington_mouse.sh


In the blank document that will open you write the following.
#!/bin/bash
xinput set-button-map 10 1 1 3 4 5 6 7 2 ;

You save the file and exit.

You then go to /home/<yourusername> to find the file "kensington_mouse" (you need to press ctrl+H to view it as it will be hidden). You right click on the file>properties>permissions and you tick the box that says "allow executing as a program".
You click ok and exit.

Then you go to startup applications>add and in the command field you navigate to /home/<yourusername>/kensington_mouse.sh

At least this is what I believe, but I really hope that the instructions on my previous post will do the job. :mrgreen:


I can get to where I change the file's permission and can't. It says I can't because I don't own the file. Root is showing as owner. So, I tried logging in as root by su - in a terminal. Shows me as logged in as root with the # instead of $. Same results.

Image

There is only one user account on my installation. I tried clicking on the home folder and changing the permissions. It will allow me, but makes no difference concerning the kensington file created.

I really do appreciate all suggestions. I've ran out of things to try from searches.

Wolfman

Fri Aug 03, 2012 5:43:39 am

Hi,

to sudo as root, did you do:

Press Alt +F2 and then enter:

gksudo nautlius

which will give you root control in home, remember that whatever folders and files you change as root that you need to set permissions for normal users too in the permissions window!!.

You will only have root permission for a short while, if you don't do anything for a while, the root permission will be retracted and you will have to sudo again.

Regards Wolfman :D

madvinegar

Fri Aug 03, 2012 5:55:37 am

Exactly as WM says.

And if you want to do it from terminal
Code:
sudo chmod a+x /home/<yourusername>/kensington_mouse.sh

madvinegar

Fri Aug 03, 2012 10:31:05 am

WMC77 wrote:
There was a zero at the end of exit. I tried multiple times with and witrhout it. Same results. Nothing happened.


Fyi, there should be a "0" in the end.
The file must end like this
exit 0

This is "exit <space> 0" (not "exit0")

Try the script though. I altered it a little bit. Now it is:

#!/bin/bash
xinput set-button-map 10 1 1 3 4 5 6 7 2
exit 0

WMC77

Fri Aug 03, 2012 2:51:03 pm

My kung fu is weak!

It is working now. The button mapping is staying on after rebooting. Thanks both of yaw very much. I'll peek into getting drag to work another day. This was time consuming enough figuring out in itself.

Thanks again.