>>>There are five ways out of a test box (at least for the purposes of this discussion: You reach the number of characters supplied in the input mask, press enter, tab, shift + tab, or click on another control. If CONFIRM is OFF, in the first case you'll get the last key press. If you don't reach the number of characters in the input mask, pressing Enter returns 13, tab, 9, shift + tab 15, and clicking on another control 7. However, if CONFIRM is set to ON, then LASTKEY() will always return 13 when Enter is pressed or another control is clicked on, and tab and shift + tab the same as before.
>>
>>
Remarks
>>
>>The values returned by LASTKEY( ) are the same as the values returned by INKEY( ). See INKEY( ) for a list of keys and their return values.
>>
>>LASTKEY( ) is updated when you move between controls.
>
>Yeah, that's right. However, in the Valid event, you haven't yet moved to another control. It's up to Valid to make that determination. That's why you can check either INKEY() or LASTKEY()
I haven't tested what goes on when the typeahead buffer is already filled past the item which fires the Valid(), so I'll assume that you're right. My intention will be to fill the typeahead buffer using Wscript.Shell's AppActivate() and SendKeys() immediately after having VFP call Sleep() for ~ 10 seconds, and trap the results on wakeup, and at Valid() and LostFocus().