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.

Code Snippets / [DBP] - Key Switch

Author
Message
luskos
12
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 22nd Nov 2012 12:22
With this little function you can use keys as a switch.You can use it to open/close windows or activate and deactivate ability or whatever you need with just one key.Replace text lines with your own code.



Coding is My Kung Fu!
And My Kung Fu is better than Yours!
MrValentine
AGK Backer
8
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 22nd Nov 2012 17:46
There is a much more simple method found inside DarkSource you know...

Does not require DLL calls either... can be achieved using Inkey$() or Keystate() with toggle strings...

Phaelax
DBPro Master
16
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 22nd Nov 2012 22:13
Two different variables to store the on and off state? No good mate.

Whenever you press a key, just do this:
on = 1 - on

"You're not going crazy. You're going sane in a crazy world!" ~Tick

Login to post a reply

Server time is: 2019-10-18 01:01:50
Your offset time is: 2019-10-18 01:01:50