Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


DirectInput Help

This topic is 6083 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I have a gateway keyboard with special keys like play/pause, stop, forward, and backward for CD stuff. I trying to use Direct Input to control the keys to allow me to stop or pause my CD. It''s not working and I was wondering if it required any special initialization or something? I works for everything else. Thanks // code to check if key pressed if (key.cKey [DIK_PLAYPAUSE] & 0x80) c_Mp3->pauseMp3 (); if (key.cKey [DIK_STOP] & 0x80) c_Mp3->stopMp3 ();

Share this post

Link to post
Share on other sites
Have you defined DIK_PLAYPAUSE as a value from 0 to 255. Direct
Input only gets the value of the extended ASCII character set.
If your keyboard can be set up so that those ''special'' keys are
bound to a value (from 129-255 say) then DI should be able to
identify them. Although DI is low level and might (??) bypass
any windows drivers.

If you plan to distribute your app/game then don''t forget that most computers without Gateway keyboards will need another method to indicate play/stop/pause.


Share this post

Link to post
Share on other sites
DirectInput defines DIK_PLAYPAUSE in dinput Header File.

// inside dinput.h
#define DIK_PLAYPAUSE 0xA2

Therefore, the value is 161 if my hex is correct and is automatically bound. I guess its probably an error in my driver file or don''t have a custom driver to support my keyboard.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!