Hey everyone! I'm new to these forums and new to scripting. I've been lurking around the site to try and comprehend how to do a simple script. But I've hit somewhat of a roadblock, so I need some help.
Here is what I need my script to do:
If I press the NUMPAD9 button, I want the script to press down and hold NUMPAD4, NUMPAD5 and NUMPAD6 at the same time, and release those three buttons once I release the NUMPAD9 button.
Here's the script that I came up with:
#include <Misc.au3>
Local $hDLL = DllOpen("user32.dll")
While 1
Sleep(10)
If _IsPressed("69", $hDLL) Then
Send("{NUMPAD4 down}")
Send("{NUMPAD5 down}")
Send("{NUMPAD6 down}")
Else
Send("{NUMPAD4 up}")
Send("{NUMPAD5 up}")
Send("{NUMPAD6 up}")
EndIf
WEnd
DllClose($hDLL)
Now here's the problem... The script seems to be doing what it's supposed to. But every now and then, the buttons NUMPAD4, 5 and 6 seem to stop working. After pressing them a few times they work again.
I can't figure out why this is happening, and it's not a keyboard (that is, mechanical) problem.
Also... If there is a way for this script to be written to have minimal delay, that would be great.
Thanks for taking your time to help me.