Global SetKeyDelay? Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
Mikael63
Posts: 12
Joined: 24 Sep 2019, 08:47

Global SetKeyDelay?

Post by Mikael63 » 26 Jan 2023, 13:48

v2 is too fast! Need to slowdown each keypress. How to set a global value for it?
Either in my ahk-file or as a global setting for all ahk-files.

Mikael63
Posts: 12
Joined: 24 Sep 2019, 08:47

Re: Global SetKeyDelay?

Post by Mikael63 » 26 Jan 2023, 16:11

Or.. maybe it is just one single paste for all?

Example:

Code: Select all

#HotIf WinActive("ahk_class BricscadMainWindow", )
^!5::Send("(cmd_setenv `"epcb_cmd`" `"PROJ_ANALYS`"){ENTER}"), Sleep(3000), Send("(cmd_setenv `"epcb_cmd`" `"PROJ_XREF`"){ENTER}")

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

Re: Global SetKeyDelay?

Post by mikeyww » 26 Jan 2023, 16:31

Code: Select all

#Requires AutoHotkey v2.0
SendMode 'Event'
Loop 10
 Send A_Index ' '
Loop 200
 Send 'x'
Explained: SendMode
Input: This is the starting default used by all scripts. It uses the SendInput method for Send, SendText, Click, and MouseMove/Click/Drag.

Mikael63
Posts: 12
Joined: 24 Sep 2019, 08:47

Re: Global SetKeyDelay?

Post by Mikael63 » 27 Jan 2023, 02:24

Thanks! Unsure how to use it? My file is as below. Worked fine for many years now (or the v1 version of it)

And I may explain little - I am using a programable mini-keyboard where one button is programmed to do like ^+D

Code: Select all

; Exempel på hotstring. Nertryckning av tangenterna krävs, det går inte att klistra in.
;:c*:ftw::Free the whales

;Exempel
;^F9::Send ('mintext')

F1::Send("{ctrl down}c{ctrl up}")

^'::A_Clipboard := A_Clipboard   ; Convert any copied files, HTML, or other formatted text to plain text

F4::Send("{ctrl down}v{ctrl up}")

^5::WinMinimize("ahk_class BricscadMainWindow")

^6::WinRestore("ahk_class BricscadMainWindow")

^F1::Send("*.*md;*.bak;*.lck;felrapport;*.scr;*.db;*.log;*.old*;*.tmp;*.$*mdb;Preview")

^F9::Send("{F2}{Del}{down}")

^+T::Send(A_YYYY "-" A_MM "-" A_DD " " A_Hour ":" A_Min "{Space}")
^+D::Send(A_YYYY "-" A_MM "-" A_DD "{Space}")

; Kopiera symbol, triggas av musknapp G6, funkar bara i Bricscad
#HotIf WinActive("ahk_class BricscadMainWindow", )
^!1::Send("(if (elpr_copyss (ssget `"I`")) (elpr_snddb (ssget `"P`") `"BLK_COPY`")){ENTER}")

; Kopiera symboler till urklipp 0,0, funkar bara i Bricscad
#HotIf WinActive("ahk_class BricscadMainWindow", )
^!2::Send("(if (elpr_selbase) (elpr_movcpy 3 (ssget `"P`"))){ENTER}0,0{ENTER}")

; Klistrar in symboler från urklipp 0,0, funkar bara i Bricscad
#HotIf WinActive("ahk_class BricscadMainWindow", )
^!3::Send("(if (elpr_movcpy 2) (progn (elpr_explode (ssget `"L`")) (elpr_snddb (ssget `"P`") `"BLK_AEDIT`"))){ENTER}0,0{ENTER}")

; Multikopiera symbol, funkar bara i Bricscad
#HotIf WinActive("ahk_class BricscadMainWindow", )
^!4::Send("(load `"elpratte`") (elp_attecopy){ENTER}")

; Analys+korsref, funkar bara i Bricscad
#HotIf WinActive("ahk_class BricscadMainWindow", )
^!5::Send("(cmd_setenv `"epcb_cmd`" `"PROJ_ANALYS`"){ENTER}"), Sleep(3000), Send("(cmd_setenv `"epcb_cmd`" `"PROJ_XREF`"){ENTER}")
Last edited by Mikael63 on 15 Mar 2024, 10:35, edited 1 time in total.

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

Re: Global SetKeyDelay?  Topic is solved

Post by mikeyww » 27 Jan 2023, 06:09

You take the first two lines of my script, and make them the first two lines of your script.

Mikael63
Posts: 12
Joined: 24 Sep 2019, 08:47

Re: Global SetKeyDelay?

Post by Mikael63 » 27 Jan 2023, 07:56

Ah! Thx!

coss101
Posts: 1
Joined: 14 Mar 2024, 16:16

Re: Global SetKeyDelay?

Post by coss101 » 14 Mar 2024, 16:28

I thought I was the only one writing AHK scripts for "Elprocad"

Can't seem to DM you here on the board., but feel free to get in touch if you wanna discuss more AHK and Elprocad/Bricscad customisations :)

Mikael63
Posts: 12
Joined: 24 Sep 2019, 08:47

Re: Global SetKeyDelay?

Post by Mikael63 » 15 Mar 2024, 10:37

coss101 wrote:
14 Mar 2024, 16:28
I thought I was the only one writing AHK scripts for "Elprocad"

Can't seem to DM you here on the board., but feel free to get in touch if you wanna discuss more AHK and Elprocad/Bricscad customisations :)
:geek: 8-)

Post Reply

Return to “Ask for Help (v2)”