Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Shortcut Conflict
#1
My macro runs on a software which has already F4 as accelartor key. Now my macro simply press F4 and enter key till the user keep F4 pressed. The macro runs fine in QM. But when compiled to exe it doesnot do anything and no error is generated. What could be the problem.

Macro just contain :
spe
'F4Y

Keyboard shortcut is also F4.

If I change the keyboard to any other key it works fine in exe too. But I want F4 only as keyboard trigger.
#2
Do you use RegisterHotKey in exe? If the target window used it first, your RegisterHotKey will fail (return 0). If you use it first, the target window will fail to register it. If the target window uses some other method to intercept the hotkey, then your RegisterHotKey will succed, but if your macro presses F4, it will be triggered itself. In either case, if you need F4 trigger, use low level keyboard hook instead of RegisterHotKey.
#3
Please provide a piece of code for low level keyboard hooks.
#4
Search for SetWindowsHookEx.
#5
How can I know that the target window is using what way to register hotkeys?
#6
You cannot know it. But if your hotkeys stop working when you open the window, you can guess that the program uses same method, or a lower level method, for example thread-specific hooks.


Forum Jump:


Users browsing this thread: 1 Guest(s)