Regarding the middle button

Started by Rui 'Trovatore' Pires, Tue 13/04/2004 19:05:19

Previous topic - Next topic

Rui 'Trovatore' Pires

<here follows a probably lame question that will probably be replied by one single person and after which the thread will go down into oblivion because, well, it's a lame question, but one which has been bothering me...>

I just bought a new mouse, with a scroll button. Does it count as a middle button when I press it? Because when I press it, AGS counts it as right-clicking. I don't know whether it IS a middle button, but I DO know that pressing it out of AGS does NOT process it as right click... (actually it does not seem to process at all, but since I doubt that Windows has much use for that button, I guess nothing's configured to happen). Even when I add a line like "else if (button==MIDDLE) {", it STILL processes it as right click...
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Pumaman

The middle button rarely works as such - AGS simply uses DirectX to get mouse clicks, but generally the mouse wheel will register as either the left or right button rather than the middle. Not much I can do, I'm afraid.

You can however use the WHEELNORTH and WHEELSOUTH events to handle actually scrolling the mouse wheel, if you like ;)

Gilbert

And always remember, even if you utilize the middle button/wheel functions, make the game playable without them, as some people (like me) don't have a 3-button/wheel mouse.

Radiant

A workaround that tends to solve this problem is the following.
In most windows versions, you can set the middle mouse button to 'do something' such as a context menu or location help. This is done in the system config panel. Set it to 'left double click'.
Then in AGS (or whatever else you're using) detect double clicks and handle them differently.
For reasons unknown to me it is inherent in windows that applications tend not to be sent the WM_MIDDLEBUTTONDOWN and _UP messages. So blame Bill.

Kweepa

Quote from: Radiant on Wed 14/04/2004 15:47:37
A workaround that tends to solve this problem is the following.
In most windows versions, you can set the middle mouse button to 'do something' such as a context menu or location help. This is done in the system config panel. Set it to 'left double click'.
Then in AGS (or whatever else you're using) detect double clicks and handle them differently.

You can't expect users to change their settings though...

Quote
For reasons unknown to me it is inherent in windows that applications tend not to be sent the WM_MIDDLEBUTTONDOWN and _UP messages. So blame Bill.

I never noticed that. WM_MBUTTONDOWN, WM_MBUTTONUP are usually sent fine, and have been since Win 95. I don't recall writing any DirectX stuff with mouse buttons but doesn't it just translate to an event with a Windows message (ie a WM_*)?

I can understand if Allegro is changing them, but that should be fixable.
Still waiting for Purity of the Surf II

Pumaman

I'm not sure where exactly the problem is - as you say, it could be Allegro, DirectX or just Windows sending the wrong message. Either way, it's not something I've really got the time to investigate.

Kweepa

That's cool. I don't care about the middle mouse button.
I was just defending my buddy Bill :)
Still waiting for Purity of the Surf II

SMF spam blocked by CleanTalk