Turn off control key repeat

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
pykemi
Posts: 2
Joined: 02 Aug 2021, 13:59

Turn off control key repeat

02 Aug 2021, 14:24

Hello,
I am a fresh user to AutoHotKey -- when using a graphical (Cad/CAM) program on my computer, the rotation command is the control key + the left mouse button. My problem is the control key floods Windows keyboard buffer and slows the rotation of the model. I would like to use the keywait function to limit this, but so far, no luck.
This is what I have so far.

Code: Select all

#IfWinActive ahk_exe Rtm.exe
KeyWait, LControl
return
#IfWinActive 
[Mod edit: [code][/code] tags added; topic moved from AHK v2 help.]

Any help would be great.
User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: Turn off control key repeat

02 Aug 2021, 15:21

#If is used for hotkeys & hotstrings.

Maybe something like this.

Code: Select all

#IfWinActive ahk_exe Rtm.exe
^LButton::
While GetKeyState("LButton", "P") {
 Send ^{LButton}
 Sleep, 50 ; Adjust as needed
}
Return
#IfWinActive
For a single activation:

Code: Select all

#InstallKeybdHook
#IfWinActive ahk_exe Rtm.exe
^LButton::
SoundBeep, 1500
Send ^{LButton}
KeyWait, Ctrl
SoundBeep, 1000
Return
#IfWinActive
pykemi
Posts: 2
Joined: 02 Aug 2021, 13:59

Re: Turn off control key repeat

03 Aug 2021, 08:13

Thank you very much for your help. I will test is today!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: mikeyww and 316 guests