开发者

capture joystick extra buttons

Could someone please tell me if there is a way to capture extra joystick buttons? I mean buttons number 5,6,7,8 and so on.

I use this code to capture button down event :

procedure MMJOY1BUTTONDOWN (var LocMessage: TMMJoyStick)开发者_StackOverflow; message MM_JOy1BUTTONDOWN;

But the problem is that it just captures the 4 standard buttons, not any extra buttons.

Thanks a lot


The Multimedia Joystick API does not support generating window messages for buttons 5+, you have to poll their status manually using joyGetPosEx(). Otherwise, you should use DirectInput from the DirectX API instead, as it replaces the older API.

Update: Alternatively, you can use the Raw Input API to receive event notifications directly from the joystick hardware. See CodeProject for more details:

Using the Raw Input API to Process Joystick Input

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜