|
Post by mjhauptfleisch on Jul 3, 2023 10:02:16 GMT -5
how can i trap the wheel-event on the mouse?
event scrollUp event scrollDown
|
|
|
Post by tsh73 on Jul 3, 2023 10:12:31 GMT -5
|
|
|
Post by Walt Decker on Jul 4, 2023 9:33:43 GMT -5
Are you familiar with the win API? If so you may be able to capture the mouse wheel event by using User32.dll function GetAsyncKeyState() using VK_ZOOM.
|
|
|
Post by Rod on Jul 4, 2023 9:59:47 GMT -5
Interesting if possible.
|
|
|
Post by Walt Decker on Jul 4, 2023 11:45:25 GMT -5
If capturing the mouse wheel does not work you can obtain the same functionality by capturing the middle mouse button using VK_MBUTTON and modifying the behaviour by pressing either CTRL or SHIFT at the same time. In your key trap you would then first get the state of VK_CONTROL and VK_SHIFT then check the state of VK_MBUTTON. Using CTRL for scroll up and SHIFT for scroll down you can accomplish the same thing.
|
|
|
Post by Walt Decker on Jul 4, 2023 13:38:00 GMT -5
Another possibility is to use User32.dll function mouse_event(dwFlags, dx, dy, dwData, dwExtraInfo). The cursor position is returned in dx, dy, and wheel movement is returned in dwData.
EDIT:
Wrong function. That function synthesizes the mouse wheel movement. It does not return anything.
|
|
|
Post by tsh73 on Jul 4, 2023 16:09:56 GMT -5
|
|
|
Post by Rod on Jul 5, 2023 4:23:45 GMT -5
Yeah, it seems we need to trap the windows message with WMLiberty. While VK_ZOOM exists there is zero info on how it is generated/used.
|
|
|
Post by Rod on Jul 5, 2023 6:27:43 GMT -5
I notice that there is a mouse reading routine just as there is a keyboard reading routine. Perhaps Walt can help us make that read the scroll wheel directly.
|
|
|
Post by tsh73 on Jul 5, 2023 7:11:33 GMT -5
I am inclined to think that "VK_ZOOM" was inserted by Microsoft for their keybords with extra keys There were keyboards with "zoom slider". Along with "VK_PLAY" and stuff. (and all that stuff needs Microsoft drivers as well)
|
|
|
Post by Walt Decker on Jul 5, 2023 10:30:01 GMT -5
Rod, what you posted is a structure passed to User32.dll GetInput(). I saw that in my win data base and thought about mentioning it, but decided not to. I will check out its functionality later today and let you know.
|
|
|
Post by Walt Decker on Jul 6, 2023 9:36:01 GMT -5
My investigation indicates that trying to trap the mouse wheel movement without using a dll is not feisable in LB. The mouseinput structure is only used to simulate mouse movement and mouse wheel rotation, not to return the mouse event information.
To simulate mouse wheel movement it would be better to use the right mouse button in conjunction with CTLR and SHIFT and capture the state with getasynckeystate().
|
|