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 / checking for a single-click

Author
Message
elantzb
16
Years of Service
User Offline
Joined: 10th May 2008
Location: Classified
Posted: 26th Jun 2008 02:55 Edited at: 26th Jun 2008 03:04


extremely useful, i believe.

good/useless?
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 26th Jun 2008 03:49
Nice.
SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 26th Jun 2008 22:20
You assign bBtnDown to false when it's initialized, therefore the first if statement is unnecessary. Just for optimization's sake, you ought to take it out.


My site, for various stuff that I make.
SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 26th Jun 2008 22:40
Ah! I hadn't paid any attention to that. Just reading over it fast.


My site, for various stuff that I make.
elantzb
16
Years of Service
User Offline
Joined: 10th May 2008
Location: Classified
Posted: 27th Jun 2008 11:22
did i do good?

~you can call me lantz~
Mahoney
16
Years of Service
User Offline
Joined: 14th Apr 2008
Location: The Interwebs
Posted: 27th Jun 2008 12:09
That you did. That you did.
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 27th Jun 2008 21:39


How's that?

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 28th Jun 2008 00:30 Edited at: 28th Jun 2008 00:39
That won't work since the same variable is used for each key

Here is a fixed and optimized version:


The array does not need to be initialized, because as soon as the key is ever not pressed, the function will automatically initialize it.

Yuor signutare was aresed by a deslyxic mud...
Curious? CLICK HERE!
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 28th Jun 2008 04:07
It did work, and I thought about doing that. I guess it wouldn't behave right if you had more than one down.

elantzb
16
Years of Service
User Offline
Joined: 10th May 2008
Location: Classified
Posted: 28th Jun 2008 04:46
would that need a loop?

~you can call me lantz~

Login to post a reply

Server time is: 2024-09-30 01:27:48
Your offset time is: 2024-09-30 01:27:48