Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
More arguments expected
I'm working on a keyboard hook that can launch three different kinds of applications and a SendKeys sequence within those applications.
Apparently RegisterHotKey is expecting more arguments on line 3 and 4 (where I am trying to register NumKey 9 and 6).

Error in <open ":2992: /147">Test Hook:  expected 4 arguments, not 3.

What am I doing wrong?

Macro Test Hook
Select All      Help
__RegisterHotKey hk1.Register(0 1 MOD_CONTROL|MOD_ALT VK_DOWN)
__RegisterHotKey hk2.Register(0 2 MOD_CONTROL|MOD_ALT VK_UP)
__RegisterHotKey hk3.Register(0 3 VK_NUMPAD9)
__RegisterHotKey hk4.Register(0 4 VK_NUMPAD6)

,if(GetMessage(&m 0 0 0)<1) break
,sel m.message
,,case WM_HOTKEY
,,sel m.wParam
,,,case 1 
,,,run "C:\Program Files (x86)\Test\App1.exe"
,,,case 2 
,,,run "C:\Program Files (x86)\Test\App2.exe"
,,,case 3
,,,run "C:\Program Files (x86)\Test\App3.exe"
,,,case 4 
,,,key T           ;; Tab
,,,key Y           ;; Enter

,DispatchMessage &m

need to fix these two lines  from
__RegisterHotKey hk3.Register(0 3 VK_NUMPAD9)

__RegisterHotKey hk4.Register(0 4 VK_NUMPAD6)


__RegisterHotKey hk3.Register(0 3 0 VK_NUMPAD9)

__RegisterHotKey hk4.Register(0 4 0 VK_NUMPAD6)

the Register function requires 4 arguments and you have only 3 so

need to add a 0 to the mod key argument to tell the function your not using a modifier key

Tip: in the qm editor if you left click a word  for example Register. Then look in qm status bar window and it will show you what is required. Also you can then press F1 to read more info about that function
Ah, I see. Thanks!

Forum Jump:

Users browsing this thread: 1 Guest(s)