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.

Newcomers AppGameKit Corner / [SOLVED] Problem with 'GetRawMouseLeftPressed()'

Reviewed AGK on Steam
Years of Service
User Offline
Joined: 10th Jul 2005
Location: California, US
Posted: 24th Oct 2019 19:27
In my Game I need to use 'GetRawMouseLeftPressed()' which works fine until I go to my next game level, and then 'GetRawMouseLeftPressed()' is still returning a 1 and screws up the next level.
So, how do I clear the cache so 'GetRawMouseLeftPressed()' doesn't keep returning a 1 ?
Please anyone know?

The author of this post has marked a post as an answer.

Go to answer

Virtual Nomad
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 24th Oct 2019 20:14 Edited at: 24th Oct 2019 20:23
This post has been marked by the post author as the answer.

running this:

does what the docs say it will (for me):
Quote: "GetRawMouseLeftPressed
Returns 1 if the left mouse button has been pressed, then returns 0 whilst the button is held down. If no mouse exists it will always return 0. "

IE, if LMB was pressed @ sync = 1. if STILL HELD at next sync = 0.

Quote: "GetRawMouseLeftPressed() is still returning a 1"

i can't reproduce your issue. is your code more elaborate than the above?

add: another way to accomplish what i think you want:

Valued Member
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 4th Nov 2019 13:16 Edited at: 4th Nov 2019 13:20
I've just tried testing GetRawMouseLeftPressed(), and it keeps returning 1 until SYNC() is called (and I am guessing that if you break up SYNC() into RENDER() and the likes, you have to call UPDATE() also). In fact, I think you can call UPDATE() when switching levels so that stuff will update without graphics are updating.

A little tip, this is how I check mouse, buttons, keys, etc:

Login to post a reply

Server time is: 2020-07-02 07:52:30
Your offset time is: 2020-07-02 07:52:30