Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get items that are in the keyboard buffer.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00416754
Message ID:
00416767
Vues:
25
>This could do the trick...I'll give it a try, my only concern is that it might kinda be a CPU hog...
>

INKEY() returns 0 immediately if no character is available for reading; just make sure to not specify a value as a parameter, and you've exhausted the buffer if CHRSAW() returns false - again no parameter to get the status immediately. Try something like:
LOCAL nNumChars, aKeyValArray[1]
nNumChars = 0
DO WHILE CHRSAW()
   nNumChars = nNumChars + 1
   DIMENSION aKeyValArray[nNumChars]
   aKeyValArray[nNumChars] = INKEY()
ENDDO
>>>>Is there a way to get the items that are in the keyboard buffer?
>>>>
>>>
>>>Spin through with INKEY() to capture a value at a time; it's a destructive read, though so you'd need to reinsert the content via KEYBOARD or API calls to PostMessage() or keybd_event() to get them back to be procesed.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform