Request: I would like the ability to type inside a gui, when the gui is the active window.
Issue: When the gui is not active, it still grabs the first character. (see gif below)
Question: How can I type inside the active gui window and resume normal typing when the gui is not active?
Notice how the letter "H" gets stuck in the gui.
Code: Select all
#Persistent
#SingleInstance Force
SingleKey := ""
SetTimer, DisplayLabel, on
Gui,add,text, w300 vMyTextVar,
gui, show, w300,Text_Window
return
DisplayLabel:
If WinActive("Text_Window")
{
Input, SingleKey, L1,
DisplayText .= SingleKey
GuiControl,, MyTextVar, %DisplayText%
}
Return
~Backspace::
If WinActive("Text_Window")
{
Length := StrLen(DisplayText)
Length--
DisplayText := SubStr(DisplayText, 1, Length)
GuiControl,, MyTextVar, %DisplayText%
}
Return
~Esc::
ExitApp