Modify

Opened 16 years ago

Closed 16 years ago

#1651 closed Feature Request (Completed)

Addition to _IsPressed page in Help file

Reported by: Melba23 Owned by: J-Paul Mesnage
Milestone: 3.3.7.0 Component: Documentation
Version: Severity: None
Keywords: Cc:

Description

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

Attachments (0)

Change History (2)

comment:1 by TicketCleanup, 16 years ago

Version: 3.3.6.0

Automatic ticket cleanup.

comment:2 by J-Paul Mesnage, 16 years ago

Milestone: 3.3.7.0
Owner: set to J-Paul Mesnage
Resolution: Completed
Status: newclosed

Added by revision [5869] in version: 3.3.7.0

Modify Ticket

Action
as closed The owner will remain J-Paul Mesnage.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.