Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


DirectInput Key bindings


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   -  Reputation: 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?


Sponsor:

#2 Alexander Deruwe   Members   -  Reputation: 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.



PARTNERS