Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Wait For MouseWheel
#2
Function WaitForMouseWheel
Code:
Copy      Help
;/
function timeS direction [flags] ;;direction: 1 forward, -1 backward, 0 any;  flags: 1 block event

;Waits for mouse wheel forward or backward.

;timeS - 0 or timeout. Error on timeout.


opt noerrorshere 1
__Handle ev=CreateEvent(0 0 0 0)
__WindowsHook hook=SetWindowsHookEx(WH_MOUSE_LL &sub.Hook_WH_MOUSE_LL _hinst 0)
opt waitmsg 1
wait timeS H ev


#sub Hook_WH_MOUSE_LL v
function# nCode message MSLLHOOKSTRUCT&m
if(nCode<0) goto gNext

if message=WM_MOUSEWHEEL
,int v=m.mouseData
,if direction=0 or (direction>0 and v>0) or (direction<0 and v<0)
,,SetEvent ev
,,if(flags&1) ret 1

;gNext
ret CallNextHookEx(0 nCode message &m)

Also QM has mouse wheel triggers.


Messages In This Thread
Wait For MouseWheel - by stupomer - 04-07-2021, 02:41 PM
RE: Wait For MouseWheel - by Gintaras - 04-07-2021, 04:22 PM
RE: Wait For MouseWheel - by stupomer - 04-12-2021, 04:21 PM
RE: Wait For MouseWheel - by Gintaras - 04-12-2021, 05:30 PM
RE: Wait For MouseWheel - by stupomer - 04-13-2021, 02:13 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)