|
||
|
GP Mailing List
ATXGPSIG List
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: Problems with DInput
I don't know if this helps, but here is another way in windows to check for
the arrow keys, or
any other key for that matter:
if(GetKeyState(VK_LEFT) & 0x8000) // Check for the LEFT ARROW
// TURN LEFT
}
That is what I use, instead of checking WM_KEYDOWN, though it works just as
good.
I should probably be setting flags in a array of 256, for each key down...
but.. I just never
did it. I eventually will though.
GetKeyState() is a windows function, which not many people know of. I
didn't :)
you just have to & it with 0x8000.
Ben Humphrey
Game Programmer
WebHost of www.GameTutorials.com
benh@humongous.com
benjina@mindspring.com
----- Original Message -----
From: Alan Teodoro <alanteodoro@hotmail.com>
To: <gameprogrammer@gameprogrammer.com>
Sent: Thursday, July 20, 2000 7:55 PM
Subject: Problems with DInput
> Hello everyone !!
>
> I created a function to read the keyboard buffer using :
> TKeyboard::CheckKey(void)
> {
> .
> .
> hr = teclado->GetDeviceState( sizeof(buffer), &buffer );
> .
> .
> KEY_LEFT = (buffer[DIK_LEFT] & 0x80);
> .
> }
> winmain() // for example
> if (KEYLEFT)
> // do something
>
> but when I check the state of the buffer instead of be '\0\0\0\0...\0'
> the buffers contains strange caracters and I don't have how check what key
> was pressed.
>
> If someone had the same problem or know how to solve this problem, please
> help me !!
>
> Thanks..
>
>
>
> ________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
>
> =================================================================
> The GameProgrammer.Com mailing list is for the open discussion
> of any topic related to the art, science, and business of
> programming games. This list is especially tolerant of beginners.
> We were all beginners once
>
> To SUBSCRIBE or UNSUBSCꫨ please visit:
> http://gameprogrammer.com/mailinglist.html
=================================================================
The GameProgrammer.Com mailing list is for the open discussion
of any topic related to the art, science, and business of
programming games. This list is especially tolerant of beginners.
We were all beginners once
To SUBSCRIBE or UNSUBSCꫨ please visit:
http://gameprogrammer.com/mailinglist.html
|
|