is me or "addScript" doesn't work with hotkeys Topic is solved

Post AHK_H specific scripts & libraries and discuss the usage and development of HotKeyIt's fork/branch
User avatar
xMaxrayx
Posts: 367
Joined: 06 Dec 2022, 02:56
Contact:

is me or "addScript" doesn't work with hotkeys

Post by xMaxrayx » 02 Nov 2024, 12:34

seems addScript() don't add hotkeys (KEY::msgbox) formula.

Code: Select all

FutureList:= [           ;///1. variable 2. library path
    [S_EnableCode , "Code Block .ahk"]
                ]

for futureitem in FutureList{

    if _var(futureitem[1]){
        ; #Include futureitem[2]
        addScript("#Include '" futureitem[2] "'" , 1)  ;//hotkeys dont work

    }
}

addScript("A::MsgBox 'Hi'" , 2) 	;//this dont work too
https://hotkeyit.github.io/v2/docs/commands/addScript.htm
-----------------------ヾ(•ω•`)o------------------------------
https://github.com/xmaxrayx/

User avatar
xMaxrayx
Posts: 367
Joined: 06 Dec 2022, 02:56
Contact:

Re: is me or "addScript" doesn't work with hotkeys

Post by xMaxrayx » 02 Nov 2024, 12:46

the funny thing if you write something like this

Code: Select all

#HotIf
addScript('a::MsgBox()' , 2)
a::MsgBox
it will Couse this problem

Code: Select all

[Running] [pid:13208] "c:\Program Files\AutoHotkey\AHK H v2.1-14\AutoHotkey64.exe" /ErrorStdOut=utf-8 "xxxxxxxxx.ahk"
*THREAD25976?00000000008EFC18#22.AHK (1) : ==> Duplicate hotkey.
     Specifically: a

if I deleted the second line and keeped addscript() the hotkey wont work
-----------------------ヾ(•ω•`)o------------------------------
https://github.com/xmaxrayx/

User avatar
xMaxrayx
Posts: 367
Joined: 06 Dec 2022, 02:56
Contact:

Re: is me or "addScript" doesn't work with hotkeys

Post by xMaxrayx » 02 Nov 2024, 13:10

Ok seems something off when I go to hotkey list I got this

Code: Select all

Type	Off?	Level	Running	Name
-------------------------------------------------------------------
reg(no)				a

•reg: The hotkey is implemented via the operating system's RegisterHotkey() function.
•reg(no): Same as above except that this hotkey is inactive (due to being unsupported, disabled, or suspended).

seems it load hotkeys but keep them off by defoult
-----------------------ヾ(•ω•`)o------------------------------
https://github.com/xmaxrayx/

User avatar
xMaxrayx
Posts: 367
Joined: 06 Dec 2022, 02:56
Contact:

Re: is me or "addScript" doesn't work with hotkeys  Topic is solved

Post by xMaxrayx » 02 Nov 2024, 13:10

Work around but is trash because you need rewrite old hotkeys

Code: Select all

addScript('Hotkey "a", (*)=>MsgBox("Hello World") , "On"' , 1)
-----------------------ヾ(•ω•`)o------------------------------
https://github.com/xmaxrayx/

User avatar
xMaxrayx
Posts: 367
Joined: 06 Dec 2022, 02:56
Contact:

Re: is me or "addScript" doesn't work with hotkeys

Post by xMaxrayx » 04 Nov 2024, 02:32

Ok I found AHK-H 2.0v not (AHK-H 2.1v) doesn't have this bug.
-----------------------ヾ(•ω•`)o------------------------------
https://github.com/xmaxrayx/

Post Reply

Return to “AutoHotkey_H”