LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-25-2010, 09:33 PM   #1
genogebot
Member
 
Registered: Jun 2010
Location: Brisbane, Australia
Distribution: Xubuntu 16.04.1 / Linux Mint 18 XFCE / Linux Mint 18 Mate / Ubuntu Server 16.04.1 / Lubuntu 16.04.1
Posts: 146

Rep: Reputation: 20
Question How are mouse button numbers assigned in Mint / Ubuntu?


I just bought a new mouse - just a cheapie usb wheel mouse but it has an extra 'thumb' button which I thought I might as well set up to do something useful.

I used 'xev' to determine the numbers that the OS had assigned to the buttons, and I found it wasn't quite what I was expecting:
left = 1
wheel-as-button = 2
right = 3
wheel-up = 4
wheel-down = 5
thumb = 8

I thought the right button would be '2' and the 'wheel-as-button' would be 3 - that's just how I've always seen them referred to in explanations, and I thought it was standardised. Not a big deal - the context menus still pop up when I click the right button so it all works ok. (And I just discovered the wheel-as-button does a 'paste' operation when it's clicked. Weird - I've never noticed that before...)

But the thing that I find particularly odd: why is the thumb button assigned as '8'. What happened to '6' and '7'?

Does the operating system assign these numbers, or are they built into the hardware in the mouse itself?

Again, no big deal, I know I can remap the buttons if I need to, but I was just curious as to how this all works and google didn't help.
 
Old 11-26-2010, 01:23 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
I believe the button codes are configured by the x input driver that controls it, either the old mouse driver, or, in most distros these days, evdev.

There is a standard for input devices that's supposed to ensure that the basic buttons at least are always configured the same. But I believe there are quite a few oddball devices out there, especially among the cheap stuff, that while supposedly conforming to standards, in fact don't quite do what you expect them to. You seem to have found one of those.
 
1 members found this post helpful.
Old 11-26-2010, 11:27 PM   #3
genogebot
Member
 
Registered: Jun 2010
Location: Brisbane, Australia
Distribution: Xubuntu 16.04.1 / Linux Mint 18 XFCE / Linux Mint 18 Mate / Ubuntu Server 16.04.1 / Lubuntu 16.04.1
Posts: 146

Original Poster
Rep: Reputation: 20
Thanks for the response.

Yes you're probably right about this being a non-standard mouse - it's a cheapo K-Mart brand, so I doubt if standards compliance or quality control was high on the manufacturer's priority list .

I had a look at xorg.conf and there was nothing in there about button numbers, so either they're stored elsewhere or they're assigned at boot time. I did a brief search but I couldn't find any more info, so I'll be content with knowing the mouse works ok - and I just used 'b:8' to assign a function to the thumb button in xbindkeys.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ubuntu - Optical mouse assign backspace to wheel button brizboy Linux - Newbie 3 04-25-2010 11:50 PM
How could IRQ numbers assigned dynamically ...... IND Linux - Kernel 1 01-22-2010 06:23 PM
5-button mouse in Ubuntu augu2000 Linux - Hardware 1 05-28-2007 05:29 AM
5 button mouse problems in Ubuntu DownloadTHIS Linux - Hardware 1 02-08-2005 05:09 PM
middle mouse button is paste.. but what if i dont have a mid mouse button? kublador Linux - Newbie 4 09-02-2003 08:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration