Jump to content

View more

Image of the Day

雑魚は多めにして、爽快感重視にしつつ・・・(´・ω・`)
早いとこ、ベースを作って、完成にもっていかないとね。
タイトルもまだ迷ってるだよなぁ。 
#indiedev  #indiegame #screenshotsaturday https://t.co/IwVbswGrhe
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

DirectInput Key bindings

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
1 reply to this topic

#1 Zenroth   Members   

127
Like
Likes
Like

Posted 10 December 1999 - 11:40 PM

Just wondering what is the general method to remap keys to work with directinput.

I think it would be something like this no?
dword keys[of all your key constants];
Then you can later do things like keys[up]=VK_UP;

Or am i way off track here?


#2 Alexander Deruwe   Members   

122
Like
Likes
Like

Posted 10 December 1999 - 11:40 PM

You actually need a UCHAR keymap[256];
You then set the data format, acquire the keyboard, and then in your main loop get the keyboard key info with a call to IDIRECTINPUTDEVICE2::GetDeviceState();

Once you have that, you can use the keymap variable in an array, like this:

if(keyword[DIK_ESCAPE] & 0x80)
{
// escape is pressed, do something!
}

The DIK_* constants are DirectInput specific, they're not the win32 ones, and are probably explained in the SDK.

I hope this has helped. It is possible that some of the things I said don't make sense, I'm in the middle of my exams and haven't touched my compiler for 2 weeks or so.

------------------
/Alexander Deruwe





Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.