Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- NetLib for Clipper, Version 6.0 - n_onanykey( [<cproc>|<nkey>] ) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_ONANYKEY( [<cProc>|<nKey>] )


Parameters

<cProc>
Name of a procedure to call.

<nKey>
ASCII value of a key to stuff onto the keyboard.


Returns

ASCII value of the key pressed.


Description

Calls a procedure or stuffs the keyboard with a key value when the user 
presses any key that can be detected by INKEY(). The key is not removed 
from the buffer.

Note  The function looks at the DOS keyboard, not the Clipper 
internal keyboard buffer, so keys inserted with the Clipper 
KEYBOARD command will not be detected.

Trapping for this event is active only while in a wait state such as 
READ or ACCEPT.

If a procedure name is passed as the argument, it will gain control 
before Clipper processes the keypress.

Disable the event trap by passing a null string as the argument: 
N_ONANYKEY("")


Example

// Count the number of keypresses.
PUBLIC nKeyCount
N_ONANYKEY('CountKeys')
.
.
.
PROCEDURE CountKeys
   nKeyCount = nKeyCount + 1
RETURN



See Also: N_ONNOKEY()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson