Game programming

Moderators: None (Apply to moderate this forum)
Number of threads: 2070
Number of posts: 5361

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
GetAsyncKeyState Does NOT work Posted by Nebabon on 9 May 2001 at 5:22 AM
Someone PLEASE help me with this one... I get this error
R:\Career Day\Try\Pong\ThunderPong.h(611) : error C2065: 'VK_A' : undeclared identifier
whenever I try to use the virtual keys... I have encluded everything under the sun trying
to get this to work... Any help would be lovely as my patients wears thin (enter 3rd week on this one)
MSDN is less then helpfull...

I got Viscul C++ 5.00 and I am using the CMU graphics to do this pong...
What do i need to do to get the imput and what do i need to process it and basicaly anything pretaning to the keyboard.

Here's the code that is giving me all the proplems

#define KEYDOWN( vk_code ) (( GetAsyncKeyState( vk_code ) & 0x8000 ) ? 1 : 0 )
if ((GetAsyncKeyState(VK_A)&1) ==0) // KEYDOWN (VK_A)/* input == 'a'*/)

Report
Re: GetAsyncKeyState Does NOT work Posted by RagnaroK on 9 May 2001 at 5:55 AM
First:

VK_A isn't defined.
No char is defined, and no number is defined.

Use this:

VK_0 thru VK_9 are the same as ASCII '0' thru '9' (0x30 - 0x39)
VK_A thru VK_Z are the same as ASCII 'A' thru 'Z' (0x41 - 0x5A)

if you want to use the 'C' Button, write

GetAsycKeyState (0x43)

Report
Re: GetAsyncKeyState Does NOT work Posted by Nebabon on 10 May 2001 at 3:34 PM
Ok, that worked, Thanks a bunch!

Now, however, it still doesn't allow multi-key movement. For some reason, it allows only one person to move at anytime... Any comments?

Thanks

Report
Re: GetAsyncKeyState Does NOT work Posted by RagnaroK on 11 May 2001 at 12:25 AM
Mh I think thats the Keyboard buffer or something like that.
Not sure.





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.