• Advertisement
Sign in to follow this  

Hold Button Down Message

This topic is 4382 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm using VC++ with MFC to create a Windows app. On my GUI, I have standard window buttons that send the "been clicked" message to my class. I perform an action like rotating my OpenGL rendered image. However, I want to repeatedly perform this action when the user holds down the button. Hence, one press the image rotates 5 degrees. Holding the button, the image spins until released. I could just monitor the button state in a thread. However, this is wasteful. Is there a better way? Perhaps a special message? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
You can store the state of the button clicked. If the button is down it is in clicked state. if the state is already clicked you now that the button has been pressed for an unspecified amount of time. if the button isn't down set the state to unpressed, or something.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement