I want to press F + J to do MsgBox for example,
how do I do it minimizing key delay and unintended behavior when I type regularly while still maintaining this functionality in AHK?
How do I press 2 non modifier keys to do something in AHK with minimal side effects? Topic is solved
Re: How do I press 2 non modifier keys to do something in AHK with minimal side effects?
Code: Select all
f & j::MsgBox % "something"
Re: How do I press 2 non modifier keys to do something in AHK with minimal side effects?
f key doesn't work now.swagfag wrote:Code: Select all
f & j::MsgBox % "something"
Re: How do I press 2 non modifier keys to do something in AHK with minimal side effects? Topic is solved
try to add ~ before your f and j
Code: Select all
; as a hotkey it triggers a msgbox
~f & ~j:: MsgBox, hi
return
Re: How do I press 2 non modifier keys to do something in AHK with minimal side effects?
COOL! and lets say i push those keys while a text cursor is active in notepad for example, f and j are typed out and then msgbox comes upOCP wrote:try to add ~ before your f and j
Code: Select all
; as a hotkey it triggers a msgbox ~f & ~j:: MsgBox, hi return
so if i want to make sure the f and j keys dont get typed out, would this be the logical solution:
Code: Select all
; as a hotkey it triggers a msgbox
~f & ~j::
send {Backspace}{Backspace}
MsgBox, hi
return
Re: How do I press 2 non modifier keys to do something in AHK with minimal side effects?
not sure if i understand you but here is a few examples
Code: Select all
; as a hotkey it triggers a msgbox
~f & ~j:: MsgBox, hi
return
;as a string it replaces text fj for MsgBox
:R:fj::MsgBox
; as a hotkey that only works if a window is active
#IfWinActive ahk_class yourwindowname
~f & ~j:: MsgBox, hi
return
Re: How do I press 2 non modifier keys to do something in AHK with minimal side effects?
sorry for not being clear. i found this final snippet to be satisfactory. thanks for your help, I wasn't expecting to be helped this fast. I really appreciate it.OCP wrote:not sure if i understand you but here is a few examples
Code: Select all
; as a hotkey it triggers a msgbox ~f & ~j:: MsgBox, hi return ;as a string it replaces text fj for MsgBox :R:fj::MsgBox ; as a hotkey that only works if a window is active #IfWinActive ahk_class yourwindowname ~f & ~j:: MsgBox, hi return
Code: Select all
~f & ~j::
send {LCtrl Down}z{LCtrl Up}
sleep 50
MsgBox, hi
Return
Who is online
Users browsing this forum: Descolada, vikasgandhi and 332 guests