I made a simple box where it saves and reads at the beginning the hotkey that is introduced and that when pressing the Save button and pressing the hotkey, it writes for example in notepad, "hello world". all good until there.
The first problem is that I have to press the Save button so that it sends "hello world" with any key that is entered in the hotkey.
Is it possible that only when you start the window again and press the hotkey, it says "hello world"? Without having to press the "Save" button.
The second problem is optional, I really don't think it can be because I've already tried it in many ways.
As you can see there is a checkbox called "SpaceKey"
Is it possible that when setting the checkbox to 1, the hotkey is just the space bar?
Code: Select all
#SingleInstance, force
Gui, Add, Checkbox,vcheck1 gCheck_1,SpaceKey
Gui, Add, Hotkey,vKey,
Gui, Add, Button,,Save
IniRead, read1, %A_Desktop%\initest.ini, Test10, key1
GuiControl,,Key, %read1%
Gui,Show,,Test
return
Check_1:
Gui, Submit, NoHide
if (check1=1)
{
GuiControl, disable, Key
}
else
{
GuiControl, enable, Key
}
return
ButtonSave:
Gui, Submit, NoHide
IniWrite, %key%, %A_Desktop%\initest.ini, Test10, key1
HotKey, $%Key%, SayHello
return
SayHello:
Send, Hello World
return