DirectInput Help

Started by
1 comment, last by snowball123 22 years, 1 month ago
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 ();
Advertisement
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.

,Jay

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.




This topic is closed to new replies.

Advertisement