remap ctrl double tap to shift

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
TingTingin
Posts: 1
Joined: 03 Aug 2021, 20:09

remap ctrl double tap to shift

03 Aug 2021, 20:15

hi im trying to remap double tap of ctrl to shift the below code works however if i dont press a key right after double tapping ctrl i.e if i double tap and hold without pressing a key like w, instead of sending shift alone it sends ctrl and shift though if i press a button right after i can hold shift indefinitely

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#SingleInstance Force

SetKeyDelay -1

~alt::

if (A_ThisHotkey = A_PriorHotkey && A_TimeSincePriorHotkey < 350 and A_TimeSincePriorHotkey > 70){

	SendInput {Blind}{alt Up}
	SendInput {ctrl down}{shift down}
	keywait alt
	SendInput {ctrl up}{shift up}
}

return


~ctrl::

tooltip % a_timesincepriorhotkey

if (a_thishotkey = a_priorhotkey && a_timesincepriorhotkey < 350 and a_timesincepriorhotkey > 70){
	
	sendinput {blind}{ctrl up}
	sendinput {shift down}
	keywait ctrl
	sendinput {shift up}
	
}

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

Re: remap ctrl double tap to shift

11 Aug 2021, 11:13

Code: Select all

~Ctrl Up::
on := True
SoundBeep, 1500
Sleep, 300
While GetKeyState("Ctrl", "P")
 Sleep, 100
on := False
SoundBeep, 1000
Return
#If on
Ctrl::Shift
#If

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 208 guests