Take the 2-minute tour ×

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); message MM_JOy1BUTTONDOWN;

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

Thanks a lot

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

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

share|improve this answer
add comment

Your Answer


