c++ - joySetCapture doesn't work with fChanged = false -


I am using joySetCapture with fChanged (4'th parameter) = true .

I am getting a message when the situation changes, as I want. However, when a joystick button is pressed, I can not find any message.

If I use fChanged = false, wParam of periodic messages is updated correctly.

How can I get the message only when a situation or button changes, without using periodic messages?

The documentation says that if fChanged is correct, then message Only are transmitted when the status is greater than the threshold as it does not mention the buttons, so I will assume that this button does not send messages when pressed. It seems like a poor design for me, but if it is, then you have to deal with it.

Why do not you want to use periodic voting messages? Unless you set the voting gap to some reasonable (such as 16 ms for the 60Hz refresh rate), I can assure you that voting for joysticks will not hinder your application, so it There is no question of performance. Actually there is no reason to set the voting gap for something small, because the hardware does not easily send the updates fast, so you are wasting the processing cycle of the same data.

Finally, the Multimedia Joystick API is somewhat dated and it has been replaced by DirectX. You should use DirectInput instead, so that you can handle the joystick with more than 4 buttons or more than 2 axes. In addition, if you are using Xbox 360 Controller, you should use the XInput library to process them.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -