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 / [DarkGDK 2.0] Deactivate input buffering?

Author
Message
Rudolpho
13
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 17th Aug 2012 01:37
I recently noticed that DGDK2 seems to buffer all mouse / keyboard input (not sure about gamepads, joysticks, etc.). This has the highly undesired side effect that if your application runs at lower speed than whatever it might be (I'm guessing 60FPS) the functions to check these values will return old data.
Ie. my application runs at 20FPS and I hold down the left mouse button for 5 seconds then release it. dbMouseKey() will keep returning a bitmask containing 1 for 10 seconds after I release the key.

I was wondering if this is intended behaviour (because it definitively isn't how it works in either DGDK1 or DBPro) and if it might be toggleable somehow? I browsed through the documentation quickly but didn't find any such indications.


I know I can just call GetAsyncKeystate() etc. myself but I wanted to point this out since I doubt it should be acting like that.


"Why do programmers get Halloween and Christmas mixed up?"
Diggsey
13
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 17th Aug 2012 01:52
dbMouseKey isn't a function AFAIK?

[b]
Rudolpho
13
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 17th Aug 2012 02:08
My bad, it's dbMouseClick() (getting late over here )


"Why do programmers get Halloween and Christmas mixed up?"
Diggsey
13
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 17th Aug 2012 02:44
Are you sure it's not a problem with the code? I haven't been getting this delayed behaviour.

[b]
Rudolpho
13
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 17th Aug 2012 02:48
Could be, but what might cause the application to buffer up input?
All I can think of that I have that might do it is console output... hm, now that I think about it, that might be it. Will check it.


"Why do programmers get Halloween and Christmas mixed up?"

Login to post a reply

Server time is: 2019-08-26 08:29:57
Your offset time is: 2019-08-26 08:29:57