Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AltMouseTrigger help
#1
I'm playing around with the AltMouseTriggers but I can't get a basic mouse wheel trigger to work. Am I missing something?
Code:
Copy      Help
function [nCode] [wParam] [MSLLHOOKSTRUCT*m]
if(getopt(nargs)=0)
,int+ g_mhook=SetWindowsHookEx(WH_MOUSE_LL &AltMouseTriggers _hinst 0)
,opt waitmsg 1
,AddTrayIcon "mouse.ico" "My mouse triggers" ;;remove this line if tray icon is not needed
,wait -1 -V g_mhook
,ret
if(nCode<0) goto g1
if(m.flags&LLMHF_INJECTED) goto g1 ;;not user-generated

sel wParam
,case WM_MOUSEWHEEL
,if(m.mouseData>0) out "forward"
,else if(m.mouseData<0) out "backward"

g1
ret CallNextHookEx(g_mhook nCode wParam m)
#2
Is this code in function AltMouseTriggers? If not, use this function name with SetWindowsHookEx.

int+ g_mhook=SetWindowsHookEx(WH_MOUSE_LL &ThisFunction _hinst 0)
#3
Yes, it is the AltMouseTrigger function with this addition:
Code:
Copy      Help
sel wParam
,case WM_MOUSEWHEEL
,if(m.mouseData>0) out "forward"
,else if(m.mouseData<0) out "backward"
According to your notes, I should be able to just run the function by itself.
#4
It works on my computer.
Function AltMouseTriggers2
Code:
Copy      Help
function [nCode] [wParam] [MSLLHOOKSTRUCT*m]
if(getopt(nargs)=0)
,int+ g_mhook=SetWindowsHookEx(WH_MOUSE_LL &AltMouseTriggers2 _hinst 0)
,opt waitmsg 1
,AddTrayIcon "mouse.ico" "My mouse triggers" ;;remove this line if tray icon is not needed
,wait -1 -V g_mhook
,ret

if(nCode<0) goto g1
if(m.flags&LLMHF_INJECTED) goto g1 ;;not user-generated

sel wParam
,case WM_MOUSEWHEEL
,if(m.mouseData>0) out "forward"
,else if(m.mouseData<0) out "backward"

;g1
ret CallNextHookEx(g_mhook nCode wParam m)

Try to debug. Look what is g_mhook. Look whether the function is called when you move the mouse (eg insert out 1 before if(nCode<0).
#5
Ok, the problem was that I renamed the function but it was still calling &AltMouseTriggers. All works fine now.


Forum Jump:


Users browsing this thread: 1 Guest(s)