﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
276	$GUI_DISABLE on a control blocks OnEvent ESC button msg	smashly		"Run the code below, Hit the ESC key and it works as it should.
Run the code again and hit the Log In button and then hit the ESC key.
Until the GUI has lost focus and gained focus again the ESC key will not work. The problem can be replicated  in earlier versions of autoit as well.
{{{
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Opt(""GUIOnEventMode"", 1)
Opt(""GUICloseOnESC"", 1)

Global $mW = @DesktopWidth, $mH = @DesktopHeight

$hMain = GUICreate(""Point Of Sale"", $mW, $mH, 0, 0)
GUISetOnEvent($GUI_EVENT_CLOSE, ""MainEvent"", $hMain)

$LogIn = GUICtrlCreateButton(""Log In"", ($mW / 2) - 75, ($mH / 2) + 25, 150, 20)
GUICtrlSetOnEvent(-1, ""MainEvent"")

GUISetState(@SW_SHOW, $hMain)

While 1
	Sleep(100)
WEnd

Func MainEvent()
	Switch @GUI_CtrlId
		Case $GUI_EVENT_CLOSE
			Exit
		Case $LogIn
			GUICtrlSetState($LogIn, $GUI_DISABLE)
	EndSwitch
EndFunc   ;==>MainEvent
}}}
  "	Bug	closed		AutoIt	3.2.11.12	None	No Bug		
