help with convert code to ahk

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Malik233445
Posts: 1
Joined: 20 May 2022, 02:00

help with convert code to ahk

Post by Malik233445 » 20 May 2022, 02:45

hi All
I want to convert this autoit code to ahk if anybody wanna help i'll be much appreciated.
Thanks

Code: Select all

Func Local()
		While 1
		Global $hDLL = DllOpen("user32.dll")
		If _IsPressed("space", $hDLL) Then
		; Wait until key is released.
		While _IsPressed("W", $hDLL)
		Sleep(20)
		Send("{SHIFT}")
		ExitLoop
		WEnd
		EndIf
 WEnd
 EndFunc
 

User avatar
mikeyww
Posts: 26601
Joined: 09 Sep 2014, 18:38

Re: help with convert code to ahk

Post by mikeyww » 20 May 2022, 05:07

Welcome to this AutoHotkey forum!

Some ideas are below. I do not know whether this matches exactly. The :arrow: KeyHistory will show you what keys are being pressed or sent.

Code: Select all

Space::local()

local() {
 SetKeyDelay, 20
 While GetKeyState("Space", "P")
  Send {Shift}
}
Or:

Code: Select all

Space:: ; Space is the hotkey trigger
SetKeyDelay, 20
While GetKeyState("Space", "P")
 Send {Shift}
Return
To make Space into Shift:

Code: Select all

Space::Shift
Click on the posted commands to learn more about them.

Post Reply

Return to “Ask for Help (v1)”