Datapoint wrote: ↑23 Apr 2023, 17:10
Untested, but if you were to add it to my
previous post, you would add this line to the OK_Click function.
MyHotkey.AssignedKey := "*" MyHotkey.AssignedKey
That will add * to the start of the hotkey right before it is saved to INI and before the hotkey is activated.
Code: Select all
...
; Enable new hotkeys and save to INI
MyGui.Submit()
for i, MyHotkey in SavedHotkeys
{
MyHotkey.AssignedKey := MyHotkey.GUI_CtrlObj.Value
if MyHotkey.AssignedKey = ""
continue
MyHotkey.AssignedKey := "*" MyHotkey.AssignedKey ; <-- always adds * to hotkeys before they are activated and saved
Hotkey MyHotkey.AssignedKey, MyHotkey.Function, "On"
IniWrite MyHotkey.AssignedKey, A_ScriptDir "\Hotkeys.ini", "Hotkeys", MyHotkey.INI_Key
}
...
Thanks for Reply me again
hmm it looks kinda different, i am still using your first version
Code: Select all
OK_Click(*)
{
; Disable old hotkeys
for i, MyHotkey in SavedHotkeys
if MyHotkey.AssignedKey != ""
Hotkey MyHotkey.AssignedKey, "Off"
Saved := MyGui.Submit()
; Enable new hotkeys and save to INI
for i, MyHotkey in SavedHotkeys
{
MyHotkey.AssignedKey := Saved.%MyHotkey.GUI_Var%
Hotkey MyHotkey.AssignedKey, MyHotkey.Function
IniWrite MyHotkey.AssignedKey, A_ScriptDir "\Data\INI-Files\Hotkeys.ini", "Hotkeys", MyHotkey.INI_Key
}
}
There are different additional Commands, and as we all know a single wrong ! or := can fuck everything
so i am sorry if i repeat to often...
yours got a "On" after function and i got a Saved.%MyHotkey.GUI_Var% where yours got "*" MyHotkey.AssignedKey ;
i totaly dont understand your code
i am just happy u shared it with me