Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
cloudahk [2023-07-15 12:45] – [AutoHotkey v2] Capitalize MsgBox command geek | cloudahk [2024-02-08 02:01] (current) – Add compiler section geek | ||
---|---|---|---|
Line 16: | Line 16: | ||
MsgBox " | MsgBox " | ||
</ | </ | ||
+ | |||
+ | |||
+ | ===== Converter ===== | ||
+ | |||
+ | Attempt to convert AHKv1 syntax to AHKv2 using the [[https:// | ||
+ | |||
+ | < | ||
+ | ; Requires AutoHotkey v1.1.26+, and the keyboard hook must be installed. | ||
+ | # | ||
+ | SendSuppressedKeyUp(key) { | ||
+ | DllCall(" | ||
+ | , " | ||
+ | , " | ||
+ | , " | ||
+ | , " | ||
+ | } | ||
+ | |||
+ | ; Disable Alt+key shortcuts for the IME. | ||
+ | ~LAlt:: | ||
+ | |||
+ | ; Test hotkey: | ||
+ | !CapsLock:: | ||
+ | |||
+ | ; Remap CapsLock to LCtrl in a way compatible with IME. | ||
+ | *CapsLock:: | ||
+ | Send {Blind}{LCtrl DownR} | ||
+ | SendSuppressedKeyUp(" | ||
+ | return | ||
+ | *CapsLock up:: | ||
+ | Send {Blind}{LCtrl Up} | ||
+ | return | ||
+ | </ | ||
+ | |||
+ | ===== Compiler ===== | ||
+ | |||
+ | Compile C code to an AHK-compatible loader function. | ||
+ | |||
+ | < | ||
+ | #include < | ||
+ | |||
+ | MCL_EXPORT(add, | ||
+ | int add(int a, int b) { | ||
+ | return a + b; | ||
+ | } | ||
+ | |||
+ | MCL_EXPORT(sub, | ||
+ | int sub(int a, int b) { | ||
+ | return a - b; | ||
+ | } | ||
+ | |||
+ | MCL_EXPORT(mul, | ||
+ | int mul(int a, int b) { | ||
+ | return a * b; | ||
+ | } | ||
+ | </ | ||
+ |