Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
LastKey() and KeyBoard command
Message
From
20/04/2007 11:36:23
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01218287
Message ID:
01218325
Views:
18
It may be crap/old code, but I'm paying the bills again. Thanks!

>Glad to help, also glad to see your working again.
>
>Bob
>
>>Bingo! Thanks!!
>>
>>
>>IF LASTKEY() = 27
>>	KEYBOARD '9' && Just to have something for INKEY to get
>>	INKEY()
>>ENDIF
>>
>>
>>
>>>Try INKEY() to consume keystrokes
>>>
>>>or SET TYPEAHEAD TO 0 to purge buffer (set it on again after :)
>>>
>>>Bob
>>>
>>>>Ok, better, but now I don't want to see a wait window. I just want to change the value of LastKey()...
>>>>
>>>>>You are resolving LastKey in the WAIT command before it has collected the keystrokes which are only consumed while waiting for input
>>>>>
>>>>>Try
>>>>>
>>>>>KEYBOARD '999' clear
>>>>>WAIT WINDOW 'WAITING'
>>>>>? LASTKEY()
>>>>>
>>>>>Bob
>>>>>
>>>>>>Nope, LastKey() value is still 27. Strange. If I use a regular WAIT WINDOW and click the mouse, then the value will change. I'm trying to make sure that at this point in code that the LastKey() value is not 27. I really don't care what it is as long as it's not 27 and not anything that causes an action to fire.
>>>>>>
>>>>>>>Hello Jay,
>>>>>>>
>>>>>>>Try taking out the NOWAIT to give the keystrokes someplace to go.
>>>>>>>
>>>>>>>Bob
>>>>>>>
>>>>>>>>If the LastKey() value before these lines was "ESC" or 27, then why on the WAIT line is it still 27? I thought the KEYBOARD command would overwrite that? Thanks!
>>>>>>>>
>>>>>>>>
>>>>>>>>KEYBOARD '999' clear
>>>>>>>>WAIT WINDOW TRANSFORM(LASTKEY()) NOWAIT
>>>>>>>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform