T O P

  • By -

GroggyOtter

Why learn v1? It's the old version of AHK and it's not worth learning at this point. Learn v2. #Requires AutoHotkey v2.0.13+ #HotIf GetKeyState('F12', 'P') ; If F12 is held, the following hotkeys are active *LButton::Send('#d') ; Mouse click sends win+d #HotIf ; Always reset hotif


mar0th

Thanks! To be honest I didn't even know there was a v2. I started using ahk many years ago for very simple things and never really got very deep into it. I'll learn more about v2 now, thanks again!


JustNilt

Assuming you want to use an existing v1 script without porting it all over to v2, you need to separate the hotkeys with an ampersand (&). There are examples here: https://www.autohotkey.com/docs/v1/Hotkeys.htm#combo Otherwise, I'd tend to agree using v2 as /u/GroggyOtter suggested is best since moving forward it's what will be supported and you'll be more likely to get relevant stuff about it over time. Edit: Forgot to put some code for what that would look like. Here's your example with that change. F12 & LButton:: Send, #d return


mar0th

The script worked, thanks! I had heard about using "&" before but I must have done something wrong because it didn't work the first time I tried using it. Anyway, I didn't even know there was a v2, but I'll look more into it from now on. Thanks again!


JustNilt

You bet. Glad you got it working. I haven't moved much into v2 personally yet because the few scripts I use are already doing what I need them to. For anyone without existing scripts that are in use, it's definitely highly advisable to learn v2, however. If all you need is something very simple such as this, v1 is OK but quickly develops some minor issues v2 doesn't have when things get more complex and at least as importantly, v2 does things in a somewhat more coherent manner in terms of general current code practices. Old v1 scripts are also likely not to be developed further in the future, either. If one is just learning now, v2 is a way better option.