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 / [GDK] Input/Tools classes

Author
Message
Bran flakes91093
15
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 18th Jan 2010 01:14 Edited at: 23rd Jan 2010 01:51
Here are two namespaces that I made:

Tools:



and Input:



(The only reason I'm putting Tools on this is because Input::InputState relies on it)

The Input::InputState class takes input to a new level and makes everything a lot easier, instead of just using dbKeyState() and dbMouseClick(). It can check if a (virtual) key is:
-Pressed
-Held(true after one loop after being pressed)
-Down(pressed or held)
-Up(not pressed or held)
-Released(true for one loop after the key is released)
-DoubleClick(WORKS WITH KEYBOARD ALSO!!!)

The namespaces also do not rely on DarkGDK one bit, so you can use them in any application (although, Input classes need the windows message pump, so they will not work in a console application)

Comments were made with AtomineerUtils, if anyone is wondering.

Attached is the project for creating a static library.

Tell me what you think!

EDIT: New version with sample project attached.

Your_Health = (My_Mood == HAPPY) ? 100 : NULL;

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-04-26 04:06:29
Your offset time is: 2024-04-26 04:06:29