Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: TerranRich on Wed 24/06/2009 18:10:53

Title: SUGGESTION: eMouseMiddleInv (SOLVED)
Post by: TerranRich on Wed 24/06/2009 18:10:53
I was designing the GUI for my game in progress, and to my horror and shock I saw that there was no eMouseMiddleInv mouse button state! I can middle-click objects, hotspots, and characters, but not inventory items. Would it be too much trouble to include this in a future version of AGS? Pretty please? :)
Title: Re: SUGGESTION: eMouseMiddleInv
Post by: monkey0506 on Wed 24/06/2009 18:53:22
When you say you can "middle-click objects"...you mean that you are actually clicking the mouse-wheel and it's registering a mouse-click? Because if so I'd be interested what MouseButton (http://www.americangirlscouts.org/agswiki/Built-in_enumerated_types#MouseButton) is getting passed through...

Anyway, a eMouseWheelClick[Inv] mode could be useful if someone really needs it for their game, sure.
Title: Re: SUGGESTION: eMouseMiddleInv
Post by: GuyAwesome on Wed 24/06/2009 19:02:43
Clicking the mouse wheel counts as eMouseMiddle, for me at least.
On a semi-related note, is there a reason Mouse.IsButtonDown doesn't work for eMouseMiddle? I don't have any particular need for it to, so this isn't a request as such, but I just realised it didn't and it struck me as odd.
Title: Re: SUGGESTION: eMouseMiddleInv
Post by: TerranRich on Wed 24/06/2009 20:05:00
In the page you linked to, monkey_05_06, it shows "eMouseMiddle" as one of the enumerated values.

I found a workaround, but still, it shouldn't be that difficult to implement, should it? Now that three-button mouses are pretty much commonplace, there should be more support for it.
Title: Re: SUGGESTION: eMouseMiddleInv
Post by: GuyAwesome on Wed 24/06/2009 21:09:33
OK, I was playing around with this, and: it looks like if( button == 7) IS eMouseMiddleInv, it just doesn't have an enum value... At least

if (button == 7) Display("eMouseMiddleInv is real!");


Does what you'd expect, when I middle click an InvItem. Can anyone else confirm this? Am I hallucinating, or is it just not officially supported, or something?

I did a Display line to show the numeric values of the MouseButton enum, and 4 and 7 were missing. I.e.
Quote
enum MouseButton {
  eMouseLeft = 1,
  eMouseRight = 2,
  eMouseMiddle = 3,
  eMouseLeftInv = 5,
  eMouseRightInv = 6,
  eMouseWheelNorth = 8,
  eMouseWheelSouth = 9
};

Haven't found out what 4 does, mind you.
Title: Re: SUGGESTION: eMouseMiddleInv
Post by: monkey0506 on Wed 24/06/2009 21:49:52
Quote from: TerranRich on Wed 24/06/2009 20:05:00In the page you linked to, monkey_05_06, it shows "eMouseMiddle" as one of the enumerated values.

Oh crap! :-[

I don't know how I overlooked that....
Title: Re: SUGGESTION: eMouseMiddleInv
Post by: TerranRich on Thu 25/06/2009 01:01:14
Well that's very weird. I wonder what #4 does. Hmm...

Thanks, GuyAwesome! Perhaps CJ should (AHEM) update the enum specification in AGS. ;)
Title: Re: SUGGESTION: eMouseMiddleInv
Post by: Shane 'ProgZmax' Stevens on Thu 25/06/2009 07:27:32
More polling versatility is always welcome.
Title: Re: SUGGESTION: eMouseMiddleInv
Post by: Vince Twelve on Thu 25/06/2009 14:12:54
Quote from: TerranRich on Wed 24/06/2009 20:05:00Now that three-button mouses are pretty much commonplace, there should be more support for it.

Just make sure that the middle mouse button isn't necessary to play your game, or that there's another button (spacebar?) that you can use in it's place for players who are using laptops to play the game (or the rare people who don't have middle buttons on their mouse)!  Don't want to alienate too many players, right?
Title: Re: SUGGESTION: eMouseMiddleInv
Post by: Shane 'ProgZmax' Stevens on Thu 25/06/2009 16:15:50
Don't most laptops have a middle mouse button next to the pad as well, now?  I seem to remember seeing them, and if not, I think they're behind the times.
Title: Re: SUGGESTION: eMouseMiddleInv
Post by: Gilbert on Thu 25/06/2009 16:34:24
I'm always against the idea of trying to make the middle button or a mouse wheel madatory for the control scheme of any software though. It's okay if it's an option for supposely better controls but it should not be a necessity. I just couldn't see how and why this button/wheel would be considered a standard for everyone.
Title: Re: SUGGESTION: eMouseMiddleInv
Post by: Khris on Thu 25/06/2009 16:37:48
Quote from: Gilbet V7000a on Thu 25/06/2009 16:34:24I just couldn't see how and why this button/wheel would be considered a standard for everyone.
I guess the same was once said about CD drives or displays with more than two colors... ;)
Title: Re: SUGGESTION: eMouseMiddleInv
Post by: TerranRich on Thu 25/06/2009 17:05:39
I completely forgot about laptop users (even thought I was one myself for many years), so I have the spacebar map to do the same thing as the middle button. Having three interactions (walk/talk/look or walk/interact/look) was necessary if I wanted the player to be able to click on a non-walkable-area and still walk somewhere (the closest point on the walkable area to the target), as well as be able to look at objects/hotspots/characters, and interact (with objects/hotspots) or talk (with characters). Spacebar will double as the middle button, covering interact/talk.
Title: Re: SUGGESTION: eMouseMiddleInv
Post by: Pumaman on Tue 07/07/2009 20:31:05
This sounds like a reasonable suggestion, I'll look into it for a future version.
Title: Re: SUGGESTION: eMouseMiddleInv
Post by: TerranRich on Wed 08/07/2009 19:35:35
Chris... what does mode #7 do? Perhaps just defining #4 and #7 with a name (like eMouseMiddleInv) will be all that's needed.
Title: Re: SUGGESTION: eMouseMiddleInv
Post by: Ryan Timothy B on Sun 08/11/2009 02:20:03
Quote from: GuyAwesome on Wed 24/06/2009 19:02:43
On a semi-related note, is there a reason Mouse.IsButtonDown doesn't work for eMouseMiddle?

Has this been added on the AGS beta?
I have a purpose for IsbuttonDown(eMiddleMouse), so I was mainly curious.  It's for a non-adventure game. The middle mouse isn't for anything serious, just for scrolling while held down, but it would be nice to have. :P
Title: Re: SUGGESTION: eMouseMiddleInv
Post by: Pumaman on Sun 08/11/2009 17:47:27
eMouseMiddleInv has been added to the beta, IsButtonDown(eMiddleMouse) has not but I will try to squeeze it in before the Final.
Title: Re: SUGGESTION: eMouseMiddleInv
Post by: TerranRich on Mon 09/11/2009 04:18:29
Sweet! (Although I changed my system around so that middle-clicks aren't even used anymore.) :P
Title: Re: SUGGESTION: eMouseMiddleInv
Post by: monkey0506 on Mon 09/11/2009 21:11:55
Although it's reasonable to assume that most users will have a mouse-wheel, I'd also just like to add my support to the idea that there should be at least an alternate method of performing the same function. The reason being that although I have a mouse-wheel, my $20 mouse is a piece of crap. I've updated the drivers a million times and done everything I can possibly think of (right down to beating the hell out of the mouse itself) and it still does the same thing. At completely random times the mouse-wheel decides it wants to start screwing with me and incessantly scrolls the page I'm on up and down (at random) until finally I get tired of it and just get off the computer.

I actually resolved it by disabling the mouse-wheel altogether. Sucks coz now I have to manually scroll, but it's 100% better than the alternative.
Title: Re: SUGGESTION: eMouseMiddleInv
Post by: TerranRich on Mon 09/11/2009 22:47:34
My plan was originally going to have the spacebar do the same thing as the middle-button... eventually I would've had three keyboard shortcuts for each of the three mouse buttons, just in case somebody wanted that option.
Title: Re: SUGGESTION: eMouseMiddleInv
Post by: Ryan Timothy B on Tue 10/11/2009 01:15:02
And my use for the middle button is a secondary scrolling option (for ease of use).  Instead of only moving the mouse to the sides of the screen, you could instead press the middle button to scroll (that is if you wanted to / or had the button). :P