Hey, I'd like to do an action with the button DEL then send DEL
This what I started with
Local $sString = StringReplace(_NowDate(), "/", "-")
Func _Start()
_ScreenCapture_Capture(@DesktopDir & "\" & StringRegExpReplace(_Now(), '[/ :]', '-') & ".jpg")
Send("{DEL}")
EndFunc ;==>_Start
But it end up in a loop
So I looked online and I found a function with _IsPressed, it doesn't end up in a loop which is great, but the function isn't working.
HotKeySet("1", "one")
Func one()
HotKeySet("1")
$dll = DllOpen("user32.dll")
While _IsPressed(31)
_ScreenCapture_Capture(@DesktopDir & "\" & StringRegExpReplace(_Now(), '[/ :]', '-') & ".jpg")
Send("1")
Sleep(1)
If Not _IsPressed(31) Then ExitLoop
WEnd
DllClose($dll)
HotKeySet("1", "One")
EndFunc ;==>one
Button 1 is registering normally but the screen capture function isn't working.
_WinAPI_Keybd_Event(0x2E, 0)
Sleep(8)
_WinAPI_Keybd_Event(0x2E, 2)
Interestingly, swapping "1" with "{DEL}" doesn't even send the button DEL. I also tried the del button with win api, the del button still isn't being sent.
I am really confused. I just want to take a screenshot with date and time every time I press delete.