Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Inhibiting keypress
#1
Macro My First Macro
Code:
Copy      Help
rep
,
,ifk(F12) ret ;;exit if F12 is pressed
,ifk(Wn)
,,int w1=win(" - Notepad" "Notepad") ;;get window handle
,,if w1=0
,,,OnScreenDisplay "Launching Notepad" 1 0 0 0 0 0 2
,,,run "notepad.exe"
,,else
,,,OnScreenDisplay "Already Running Notepad" 1 0 0 0 0 0 2
,,,act w1

Here is my first, test macros, I am trying to supress the "n" from being passed to the focused application. I verified that the "Eat" was checked in the item properties, but the "n" is still being passed through. Ideas?
#2
What trigger?
When posting a macro to this forum, please copy it with menu Edit / Other Formats / Forum, then simply paste here. It will copy correct code and trigger.
#3
Not sure what your asking, what trigger? It fires when Win-N is pressed.

I edited my initial post, as requested.

Rob
#4
Why not use normal trigger Win+N, like this?

Macro Macro2123
Trigger Wn     Help - how to add the trigger to the macro
Code:
Copy      Help
int w1=win(" - Notepad" "Notepad") ;;get window handle
if w1=0
,OnScreenDisplay "Launching Notepad" 1 0 0 0 0 0 2
,run "notepad.exe"
else
,OnScreenDisplay "Already Running Notepad" 1 0 0 0 0 0 2
,act w1

In AHK you run a script containing triggers.
In QM you assign trigger in Properties dialog, and the script runs when you press eg Win+N.
#5
Ok, sounds good. Just learning how QM differs.

Thank you,
Rob


Forum Jump:


Users browsing this thread: 1 Guest(s)