﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
1651	Addition to _IsPressed page in Help file	Melba23	Jpm	"A few recent forum help requests have been the result of users not waiting for a key detected by ''_IsPressed'' to be released before continuing the script.  This resulted in multiple actioning of the code for that event.

Could I suggest that the following remark be added to the ''_IsPressed'' page in the Help file:

'''Remarks''':

_IsPressed will return 1 until the key is released.  Even brief key presses can result in multiple returns within  a loop.  If the code called does not include a blocking function (such as MsgBox) and the user does not require multiple returns, the script should wait until _IsPressed returns 0 before continuing.

And then alter the example as follows:
{{{
#include <Misc.au3>

$dll = DllOpen(""user32.dll"")

While 1
	Sleep ( 250 )
	If _IsPressed(""24"", $dll) Then
		ConsoleWrite(""_IsPressed - Home Key Pressed"" & @CRLF)
		; Wait until key is released
		While _IsPressed(""24"", $dll)
			Sleep( 250 )
		WEnd
	ElseIf _IsPressed(""23"", $dll) Then
		MsgBox(0,""_IsPressed"", ""End Key Pressed"")
		ExitLoop
	EndIf
WEnd
DllClose($dll)
}}}
M23"	Feature Request	closed	3.3.7.0	Documentation		None	Completed		
