guides:v1_v2_cheat_sheet

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
guides:v1_v2_cheat_sheet [2024-07-24 05:24] – [General] vmechguides:v1_v2_cheat_sheet [2025-01-13 19:37] (current) – [v1→2 Conversion Cheat Sheet] Add auto-converter widget to page geek
Line 1: Line 1:
 ====== v1→2 Conversion Cheat Sheet ====== ====== v1→2 Conversion Cheat Sheet ======
 +
 +===== Converter =====
 +
 +Attempt to convert AHKv1 syntax to AHKv2 using the [[https://www.autohotkey.com/boards/viewtopic.php?f=6&t=25100|AHK-v2-script-converter]] project.
 +
 +<converter>
 +; Requires AutoHotkey v1.1.26+, and the keyboard hook must be installed.
 +#InstallKeybdHook
 +SendSuppressedKeyUp(key) {
 +    DllCall("keybd_event"
 +        , "char", GetKeyVK(key)
 +        , "char", GetKeySC(key)
 +        , "uint", KEYEVENTF_KEYUP := 0x2
 +        , "uptr", KEY_BLOCK_THIS := 0xFFC3D450)
 +}
 +
 +; Disable Alt+key shortcuts for the IME.
 +~LAlt::SendSuppressedKeyUp("LAlt")
 +
 +; Test hotkey:
 +!CapsLock::MsgBox % A_ThisHotkey
 +
 +; Remap CapsLock to LCtrl in a way compatible with IME.
 +*CapsLock::
 +    Send {Blind}{LCtrl DownR}
 +    SendSuppressedKeyUp("LCtrl")
 +    return
 +*CapsLock up::
 +    Send {Blind}{LCtrl Up}
 +    return
 +</converter>
  
 ===== General ===== ===== General =====