SRL Archive - C/C++ Help and Tutorials

What's IsKeyDown in C++ and how do I use it?


PwNZoRNooB

2007-06-18 16:13:08

Title says it all :)

VG_Kobra

2007-06-19 18:24:23

From: PwNZoRNooB
Title says it all :)


GetChar () ?

PwNZoRNooB

2007-06-20 12:11:18

From: VG_Kobra
GetChar () ?


You need to press enter, I mean like how can you make it so in C++ that it can detect if you are pressing 'a'

Anyone?

Freddy1990

2007-06-23 13:15:59

use the GetASyncState API

Santa_Clause

2007-06-25 04:28:09

Freddy knows everything?!

Freddy1990

2007-06-25 09:02:05

Yea, pretty much ;)

Santa_Clause

2007-06-26 04:30:24

:p

syberium

2007-06-28 02:06:35

you should do someting like this:
  

void begin()
{
if (GetAsyncKeyState(VK_MENU)) //VK_MENU means alt
{
if (GetAsyncKeyState('K')) // what ever the command here!
if (GetAsyncKeyState('P')) // this would be activated if u pushed alt+p
}
}


i think thats right.. im just learning c,c++ so yea

arcix

2007-08-12 12:35:04

GetAsyncKeyState loops are rather slow, I recommend setting a global windows keyboard hook, so that your program is notified whenever a key is pressed. This way, you don't eat up CPU with an infinite loop. Here is the MSDN for the SetWindowsHookEx API that you need to use: http://msdn2.microsoft.com/en-us/library/ms644990.aspx. Use the WH_KEYBOARD_LL hook type.

Bobarkinator

2007-08-13 10:20:35

I'm sorry but I am going to have to report you PwNZoRNooB, if you look 2 topics down this question has been asked and answered.

[BANANA]NOOBNOOBNOOBNOOBNOOBNOOBNOOBNOOBNOOBNOOBNOOBNOOB
[LEFT]You, PwNZoRNooB, have been reported for being a NOOB.
Your
Current violations include
  1. Not Searching for
This brings you to a new total of (3) Noob Points!

For more information on PwNZoRNooB please go Here.

For more information from This database please go Here.

For more information on The Noob Points System please go Here.

For more information on Noobs please go Here.

[/LEFT]
NOOBNOOBNOOBNOOBNOOBNOOBNOOBNOOBNOOBNOOBNOOBNOOB[/BANANA]

Please remember next time to use the search button.

PwNZoRNooB

2007-08-14 01:49:53

The 2 topics down guy asked 08-06-2007, 10:01 PM
and I asked 06-18-2007, 11:13 PM. Erm :)
And yes I tried to search it by going through the whole C/C++ section (like 12 topics back then) :p