More than 5 mouse buttons in Windows XP+?

Started by
10 comments, last by Nypyren 15 years, 3 months ago
Hi, I have a 9-button mouse (Logitech G9) and 7 of its buttons are configured as 'Generic Button.' However, using windows messages I can only get information about the first 5. Namely the first standard three (left, middle, right) and two extra (XMOUSE1 and XMOUSE2). There seems to be no XMOUSE3 or anything similar, and searching didn't seem to yield anything helpful. What's a good way to find information about mouse down/up events for buttons 6, 7, 8, etc.? Is there a standard approach at all, or is it only possible through hacks? I'm guessing using DirectInput might one possibility, but I'd rather avoid that if possible and keep using the existing windows message loop/pump for getting mouse input. This is for the Windows version of my multi-platform project. Thanks!
Advertisement
Sorry for the lack of content, but...

Quote:Original post by shurcool
I have a 9-button mouse


O_O
You could try reading the raw USB data from it (which should be doable on any PC platform). Otherwise just use the mouse's software to bind the extra buttons to rarely used keyboard keys.

If you thought 9 buttons was a bit much, look at the Logitech MX Revolution. 11 buttons! (if you count the pseudo-scroll wheel thing on the side as 3 functions)
You'll need to register for raw input and use WM_INPUT instead of the "default" mouse functions.
Quote:Original post by Zahlman
O_O

Usually only 5 out of 9 would be configured as 'General Buttons'.

The 9 buttons are:
-left
-middle (scroll wheel press)
-right

-browser back
-browser forward (thumb keys)

-scroll wheel tilted left
-scroll wheel tilted right

-DPI increase button
-DPI decrease button

Plus it actually has two more buttons on the bottom of the mouse. But they're used for switching profile and between free-gliding/clicking mouse wheel scrolling modes, not for regular mouse presses, obviously.

Anyway, thanks for your responses guys. At least now I have a lead.
Quote:Original post by Codeka
You'll need to register for raw input and use WM_INPUT instead of the "default" mouse functions.

Thanks. Just wanna make sure, in the RAWMOUSE structure, there is a ULONG ulRawButtons; field - is that what I should be using to find out mouse state for 6th/7th/8th/etc. buttons?
Surely this is one thing Direct Input can do!??!
left, middle and right are easy
forward and backward can be a little tricky but these are called x1 and x2
scroll left & right, I would use Spy++ as a starting point and go from there, perhaps WM_HSCROLL might be of some use?
the dpi change is perhaps hidden within the mouse as I don't recall I need a software to use mine... Why do you want to use this as a form of input?
sirGustav, I know the first 5 are easy. It's getting the next buttons which is tricky, but it might be possible by using raw input/WM_INPUT.

All those buttons I've mentioned *can* be configured as 'General Buttons', and by default (without raw input) Windows will only let you know about the first 5.

Of course, the DPI buttons are internal to the mouse unless you rebind them as 'General Button' in the mouse config screen. I wouldn't do that, other than for messing around, of course. It would be nice if you could bind them to some action within my game, but I guess I'll do with just 5 buttons max for now.

Thanks anyway. :)
My mouse has a task-switch key that is totally useless in my opinion, but I re-binded it in the mouse software to function as the enter-key. Every game so far, I bind the enter-key to the use-key and the game doesn't know the difference.

For the dpi-switch you probably can set game-specific bindings within the mouse-software, and for me(and I'm guessing for most people) that is good enough if I want specific functions for my game; leaving me free to add other stuff that more people will actually use :)

This topic is closed to new replies.

Advertisement