When the window is in focus, pressing the k, l, or ; key on the keyboard (standard USB windows English keyboard) should play specific keys on the piano
I am trying to send these keypresses through AHK
Here is the code I am using for reference:
Code: Select all
$z::
KeyWait, z, T0.1
if (ErrorLevel)
Send long
else {
KeyWait, z, D T0.1
if (ErrorLevel)
; Send kl;
SendRaw kl;
; SendInput kl;
; SendPlay kl;
else
Send double
}
KeyWait, z
return
What could be the issue here? Do I need to use a different function than Send? I am a beginner to Autohot key.
I am using AutoHotkey_1.1.33.05 (portable zip file version), I use AutoHotkeyU64.exe to start AHK, Windows 10 Pro ver 1909 Build 18363.1440
Edit:
I have been looking around and it seems this could be related to some Windows permission issues (not sure about it)
I have tried running a cmd window as Administrator and I start Autohotkey from command line as
D:\ahk_folder\AutoHotkeyA32.exe D:\path_to_script_file\myscript.ahk
However, this doesn't fix the problem. What else can I do? Will doing a full install of Autohotkey fix this?