[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
##############################################################################
###+----------+###############################################################
#+-| KEYBOARD |--------------------------------------------+##################
#| +----------+ Stuffs the keyboard buffer with key_string |##################
#+---------------------------------------------------------+##################
##############################################################################
##############################################################################
#+--| Summary |------------+##################################################
#| #INCLUDE io.hdr |##################################################
#+-------------------------+##################################################
##############################################################################
##############################################################################
#+--| Syntax |-------------------------------+################################
#| PROCEDURE keyboard PROTOTYPE |################################
#| PARAMETERS CONST CHAR key_string |################################
#+-------------------------------------------+################################
##############################################################################
##############################################################################
#########+---| Description |-----------------------------------------+########
#########| The keyboard procedure stuffs the keyboard buffer with |########
#########| key_string. The FORCE library contains its own keyboard |########
#########| buffer. It is this buffer, not the BIOS keyboard buffer, |########
#########| which retrieves the characters from the keyboard |########
#########| procedure. |########
#########| --------------------------------------------------------- |########
#########| The command CLEAR TYPEAHEAD clears all pending keystrokes |########
#########| from the keyboard buffer. |########
#########+-----------------------------------------------------------+########
##############################################################################
##############################################################################
#########+--| Example 1 |-------------------------------------------+#########
#########| * Use keyboard and key_int in combination. |#########
#########| |#########
#########| keyboard("this is a test") |#########
#########| key_int( &k_enter ) |#########
#########| ACCEPT "GIVE ME A STRING" TO cvar |#########
#########| ? cvar |#########
#########| |#########
#########| Output: "this is a test" |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 2 |-------------------------------------------+#########
#########| * Force a termination of a GET (during the |#########
#########| * READ command) whenever a user presses F2. |#########
#########| |#########
#########| FUNCTION INT my_filter |#########
#########| IF lastkey() = &K_F2 |#########
#########| RETURN &k_ctrl_w |#########
#########| ENDIF |#########
#########| RETURN lastkey() |#########
#########| ENDDEF |#########
#########| |#########
#########| {...} |#########
#########| @ 0,10 SAY "Press F2 to save" |#########
#########| @ 10,10 SAY "Name: " GET z->name FILTER my_filter() |#########
#########| READ |#########
#########+----------------------------------------------------------+#########
##############################################################################
See Also:
CLEAR TYPEAHEAD
key_int
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson