Jump to content
  • Advertisement
Sign in to follow this  
shurcool

More than 5 mouse buttons in Windows XP+?

This topic is 3538 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Share this post


Link to post
Share on other sites
Advertisement
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)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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. :)

Share this post


Link to post
Share on other sites
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 :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!