16-button Logitech G5?

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
So I'm working on an event-driven input module for an XNA game framework, and doing this little bit that fills in some properties regarding the current mouse from the SystemInformation class. I have a G5, and the MouseButtons property is consistently set to 16. As generously as I can possibly count, I get 6. I didn't turn up anything relevant on Google, other than a post where some Mac user says that his G5 detected as a 16-button mouse. Anyone ever seen this before? Should I not rely on the specific button count in SystemInformation.MouseButtons?
 

Auryg

Platinum Member
Dec 28, 2003
2,377
0
71
I've never done any mouse stuff in XNA - but could it possibly be counting mouse movement as a 'button'?

I don't see how it would, but just a thought..
 

xtknight

Elite Member
Oct 15, 2004
12,974
0
71
Going off of Auryg's thought maybe mouse gestures are buttons? Who knows...

I can count 13 possible events on my G5 though (e.g. horiz scroll wheel left). It's possible I'm missing something like pressing both left+right at once, or something else but it would seem to be these are different events.

More curiously how does it know how many buttons are on the mouse? Does it poll a driver, is this provided thru USB info, WMI (but how does WMI get it)?

It would seem not to matter too much as you could give the user control over whatever buttons do exist (e.g. MOUSE1 to MOUSE16). Just listen for an event then assign it to an action. Making sense of each button # on each mouse may prove daunting.

With the 13 number I am counting DPI changes as events also in addition to the DPI up/down keys themselves which can be remapped thru the Logitech software.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
I thought about the DPI buttons myself, but I believe they only affect the electronics on the mouse, and so I didn't count them as buttons. My count is: left, middle, right, side, scroll right, scroll left. I don't think anything else on that mouse qualifies as a button (and in fact even the scroll left and scroll right are not caught by the standard windows driver, so whether they count is debateable).

All the documentation says is that SystemInformation.MouseButtons (in System.Windows.Forms, btw, but being used by my XNA framework) returns the number of buttons or 0 if no mouse is installed. I assume it polls the driver via Win32 at some level. It's not a big deal, as you only get events for the actual installed buttons, but I was curious. From what I have seen so far this is something people have noticed about certain Logitech models.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
It's possible that Logitech just screwed up and the mouse or driver returns the wrong number. Have you tried printing the source of each event and then hitting everything on the mouse to see what numbers you get back from each button?
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
Originally posted by: Nothinman
It's possible that Logitech just screwed up and the mouse or driver returns the wrong number. Have you tried printing the source of each event and then hitting everything on the mouse to see what numbers you get back from each button?

Yep, I only get data for the four installed buttons (XNA is polling-based, my module's purpose is to turn state changes into events). No issues there, but I was trying to engineer the core loop so that it doesn't spend time checking the state of buttons that aren't there.

Edit: last night I was thinking the docs might be wrong and this might be returning a bit mask... but my four button mouse should return 15 in that case, so thinking that's not right.