You can capture direct joystick messages to be sent to a function by using the joySetCapture
function. Only one application at a time can capture messages from a
joystick, but you can query the joystick from another application by using the joyGetPos
A joystick message can fail to reach the application that captured the
joystick if a second application uses joyGetPos
to query the joystick at approximately the same time that the message is
sent. In this case, the second application could intercept the message.
If you want to capture messages from two joysticks attached to the system, use joySetCapture
twice, once for each joystick. Your window receives separate and distinct
messages for each device.
You can release a captured joystick by using the joyReleaseCapture
function. If an application does not release the joystick before ending, the
joystick is automatically released shortly after the capture window is
You cannot capture an unplugged joystick. The joySetCapture
function returns JOYERR_UNPLUGGED if the specified device is unplugged.
- Software for developers
Software for Android Developers
- More information resources
Unix Manual Pages