Jump to content
  • Advertisement
Sign in to follow this  
of_ownage

detect mouse wheel

This topic is 3602 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

hey guys, i am using this macro to check for key-presses: #define KEYDOWN(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0) now how do i detect if the use presses the mouse wheel. I want to know if he scrolls with it down/up, but i have no idea if there is a VK keycode for it. Thank you for any help

Share this post


Link to post
Share on other sites
Advertisement
I believe that you can test against VK_MBUTTON with GetAsyncKeyState() to see if the button is pressed. You want to respond to WM_MBUTTONDOWN if you want notifications.

To respond to the wheel scrolling, you need to respond to the WM_MOUSEWHEEL message in your WndProc.

Look up Mouse Input in the Platform SDK help or on MSDN for more information than you could possibly ever need.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!