Jump to content
  • Advertisement
Sign in to follow this  
enmaniac

Mouse wheel (WinApi)

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

Hi! Is there a way to determine mouse wheel changes in WinApi ? I know how to do it using DirectInput but I am courious how can one do it without using DX. thx in advance

Share this post


Link to post
Share on other sites
Advertisement
You have to look for the WM_MOUSEWHEEL event in your window message processor.

You won't be able to use this message though unless you tell the compiler which windows version you are using. Define _WIN32_WINNT to 0x0400 before you include windows.h and you should be okay.

You will have to divide your scroll value by 120 to get the amount of lines to scroll. This was included to allow for devices to increase their scroll precision in the future. IIRC, the code looks like this:

HIWORD (wParam) / 120;

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!