Joystick Notification Messages
[The feature associated with this page, Joysticks, is a legacy feature. It has been superseded by Windows.Gaming.Input Namespace. Windows.Gaming.Input Namespace has been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use Windows.Gaming.Input Namespace instead of Joysticks, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]
Joystick messages notify your application that a joystick has changed position or that one of its buttons has changed states. Messages beginning with MM_JOY1 are sent to the function if your application requests input from the joystick using the identifier JOYSTICKID1, and MM_JOY2 messages are sent if your application requests input from the joystick using the identifier JOYSTICKID2.
The messages in the following table identify the status of the joystick buttons:
|MM_JOY1BUTTONDOWN||A button on joystick JOYSTICKID1 has been pressed.|
|MM_JOY1BUTTONUP||A button on joystick JOYSTICKID1 has been released.|
|MM_JOY1MOVE||Joystick JOYSTICKID1 changed position in the x- or y-direction.|
|MM_JOY1ZMOVE||Joystick JOYSTICKID1 changed position in the z-direction.|
|MM_JOY2BUTTONDOWN||A button on joystick JOYSTICKID2 has been pressed.|
|MM_JOY2BUTTONUP||A button on joystick JOYSTICKID2 has been released.|
|MM_JOY2MOVE||Joystick JOYSTICKID2 changed position in the x- or y-direction|
|MM_JOY2ZMOVE||Joystick JOYSTICKID2 changed position in the z-direction.|
All messages report nonexistent buttons as released.