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 / LOOP until keystroke?

Author
Message
Spooter
16
Years of Service
User Offline
Joined: 27th May 2008
Location:
Posted: 17th Dec 2008 00:08
Is their a way I run my program until a certain keystroke is pressed? I've looked on google and nothing is really making sense. It doesn't have to be efficient or pretty, I just need something to start with.

/*================================================*\
| Lead Programmer/Owner===============Anti-Triangle Cult=====|
\*================================================*/
Zuka
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: They locked me in the insane asylum.
Posted: 17th Dec 2008 02:46
while (dbScanCode() == 0) { }
Crazy Programmer
AGK Developer
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Lost in AGK
Posted: 17th Dec 2008 04:17

Will do it for you


Marvin the Magician by Soharix
http://forum.thegamecreators.com/?m=forum_view&t=141496&b=8&p=0
Spooter
16
Years of Service
User Offline
Joined: 27th May 2008
Location:
Posted: 18th Dec 2008 01:54
Oh... sorry for not making this clear, but I'm not using DarkGDK.

/*================================================*\
| Lead Programmer/Owner===============Anti-Triangle Cult=====|
\*================================================*/
Not_Maindric
17
Years of Service
User Offline
Joined: 10th Jul 2007
Location: Omaha, NE
Posted: 18th Dec 2008 02:11


That is what you would need for DBC/DBPro.

Spooter
16
Years of Service
User Offline
Joined: 27th May 2008
Location:
Posted: 18th Dec 2008 02:12 Edited at: 18th Dec 2008 02:24
lol, nope, just normal c++

AND also if anyone has any idea on how to check for keystrokes no matter what program i'm clicked on, instead of having to enter the code into a command line and hitting enter.

/*================================================*\
| Lead Programmer/Owner===============Anti-Triangle Cult=====|
\*================================================*/
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 18th Dec 2008 02:37
You want to make a keylogger? Nooooooob.

Spooter
16
Years of Service
User Offline
Joined: 27th May 2008
Location:
Posted: 18th Dec 2008 02:50
No.... If i wanted to make a keylogger i would just dl one. I'm making a music player that auto hides itself and shows itself with certain keystrokes. OH and btw breaking a loop when a keystroke is entered in would do nothing for a keylogger because you don't want the person to be able to show the keylogger in any way.

/*================================================*\
| Lead Programmer/Owner===============Anti-Triangle Cult=====|
\*================================================*/
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 18th Dec 2008 03:08
Dunno if it still exists but you might look to see if kbhit() is an available function. It was mostly a Borland function but when I did a test in VC++ 2005 it recognized it, compiled and linked. But when I ran it, it complained about not being able to find a specific DLL. It might be missing the dll or it might be a matter of putting it in the directory with the executable.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th Dec 2008 12:41
Ok, I have a question. If this is not a GDK question, why ask it in the GDK forum?

Next thing is that you'll tell us it's not windows either

Google for 'Windows message loop' if you are planning on a standard windows application, or 'windows console input' if it's a windows console application.

Login to post a reply

Server time is: 2024-09-30 13:22:06
Your offset time is: 2024-09-30 13:22:06