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.

Dark GDK / Pressing a key once sometimes doesn't show up :s

Author
Message
prasoc
16
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 20th Oct 2009 20:48
In my game, the buttons and mouse sometimes take a while to respond to clicks, but not to clicks that just use dbMouseClick and dbKeyState() but when I put in checks to find out when it is pressed once. This is the gist of my code:



When I use "Input::KeyOnce(17)" for W key, it sometimes doesn't respond to it and I have to press the button lots to get it to register ??? It has become more noticeable when I have uncapped the FPS, is that why?


Your signature has been erased by a mod
prasoc
16
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 20th Oct 2009 22:21 Edited at: 20th Oct 2009 22:25
Aww damn it. I just worked out that if you press a key after the function that does things with that key is over, it still updates the lastKey, but the next loop will not allow the function to run because the lastKey is actually the "ghost key" so to speak.

An example:




Your signature has been erased by a mod

Login to post a reply

Server time is: 2024-11-20 11:22:59
Your offset time is: 2024-11-20 11:22:59