Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Raw Mouse Issues

Author
Message
mindsclay
12
Years of Service
User Offline
Joined: 1st May 2012
Location: Rocklin, CA, USA
Posted: 5th Jan 2016 00:40
I need to determine which mouse button is pressed, however I am not getting any change to the values for GetRawMouseLeftPressed() nor GetRawMouseRightPressed()
home.wavecable.com/~mindsclay
Crazy Programmer
AGK Developer
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Lost in AGK
Posted: 5th Jan 2016 00:51 Edited at: 5th Jan 2016 01:01



I hope this helps. The value that is returned from checking if a statement is true is always 1 or 0. 1 being true 0 being false.


Sign up for NaGaCreMo!
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 5th Jan 2016 08:27
Two things...

Are you checking to see if the mouse button has been clicked?
In this case, I prefer to check for a release rather then a press, since the mouse can be moved between the "pressed" and "released" conditions,
and the check only happens once per program cycle. The key point is that the check only happens once per cycle, so I would capture any
needed input right when the check is made. (as Crazy does when he increments the counters above).

Or are you checking to see if the mouse button is being held down?
I would use GetRawMouseLeftState() and GetRawMouseRightState() for this test.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 5th Jan 2016 09:15
Show us what code you have so far, that might help clear things up.

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
mindsclay
12
Years of Service
User Offline
Joined: 1st May 2012
Location: Rocklin, CA, USA
Posted: 5th Jan 2016 10:31 Edited at: 5th Jan 2016 10:37
Tried this for testing purposes.

types.h



main.cpp
home.wavecable.com/~mindsclay
SoftMotion3D
AGK Developer
19
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 8th Jan 2016 15:00 Edited at: 8th Jan 2016 15:02
I see that your using getrawmousepressed. With right and left checks.

This command shows a value of 1 for only one frame when initially pressed then goes back to 0.

In agk basic you can barely notice the change written on the screen depending on set framerate.

Now in c it must even be harder to see since it runs allot faster then an interpreted language.

Try getrawmouseleftstate and right to show a value of 1 as long as its held down

Sign up for NaGaCreMo!

Login to post a reply

Server time is: 2024-11-17 02:36:47
Your offset time is: 2024-11-17 02:36:47