0

This is the code that uses jna to listen for mouse events.code detail.

I found that the scrolling code for the scroll wheel is 522, but I can't distinguish between up and down scrolling. Can I have a way to distinguish between sliding up and down the scroll wheel?

bigding
  • 25
  • 3

1 Answers1

1

In a Windows mouse hook the WPARAM will alert you to a scroll wheel event, and the LPARAM, what is called MOUSEHOOKSTRUCT info in the code link you've posted, will give you the details about the event, including here the wheel delta.

Pertinent MSDN links that reference this:

Hovercraft Full Of Eels
  • 283,665
  • 25
  • 256
  • 373
  • Thank you very much. I found the required scrolling information in the LPARAM. The following code can get the corresponding information: boolean down = Pointer.nativeValue(info.hwnd.getPointer()) == 4287102976L; – bigding Apr 23 '18 at 03:22