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 / GetPointerPressed does not work

Author
Message
Max Tillberg
18
Years of Service
User Offline
Joined: 16th Jul 2005
Location:
Posted: 4th Jul 2013 11:28
I have a problem with GetPointerPressed on T1/Build Trial 107 on Win XP laptop. The problem is that GetPointerPressed only works every second time and it does not matter how long between the presses this is. Any idea how to figure out what is wrong? The fps is between 59 and 60.


Sincerely,
Max Tillberg
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 4th Jul 2013 11:39 Edited at: 4th Jul 2013 11:41
what happens without messagebox?
maybe cleancup devices with device manager/system.
did run third party software for mouse/touchpad?

Max Tillberg
18
Years of Service
User Offline
Joined: 16th Jul 2005
Location:
Posted: 4th Jul 2013 11:44
Interesting, GetPointerState work fine every time (1) and I think GetPointerPressed works as well (it flickers so I guess I get a very short 1).

Sincerely,
Max Tillberg
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 4th Jul 2013 11:55
maybe, just move a sprite at each click to see what happens.
the messagebox was unfavorable because it have buttons and
need clicks too.
Max Tillberg
18
Years of Service
User Offline
Joined: 16th Jul 2005
Location:
Posted: 4th Jul 2013 12:07
I only used the message for debugging so I guess print will do. Thanks.

Sincerely,
Max Tillberg
Funnell7
12
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 4th Jul 2013 13:31 Edited at: 4th Jul 2013 13:33
GetPointerPressed and GetPointerReleased only return '1' for that instance (i.e. one sync). If you want the message 'Pressed' to appear whilst constantly holding, you need to use GetPointerState which you have already worked out

EDIT: Here you go, this explains it better than I did (from the help files)...

Quote: "There are three commands for getting the state of the pointer press, GetPointerPressed returns 1 the instant the pointer is pressed and then returns 0, GetPointerReleased returns 1 the instant the pointer is released and then returns 0, GetPointerState returns 1 the entire time the pointer is in the pressed state."
Marl
12
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 7th Jul 2013 15:44 Edited at: 7th Jul 2013 15:47
I got caught out by this when I started AppGameKit, It's just too fast to see.

As stated already pressed and released are one loop deals and are changed on the sync(), so assuming the pointer is pressed during loop 10 and released during loop 90 (registered by AppGameKit during sync() at the end of the loop), in truth table for this would give;

So getPointerPressed() and getPointerReleased() are set for the frame where getPointerState() changes to 1 and 0 respectively.

Nothing new, just another way to explain it.

Login to post a reply

Server time is: 2024-05-04 02:53:35
Your offset time is: 2024-05-04 02:53:35