home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 19
/
CD_ASCQ_19_010295.iso
/
dos
/
prg
/
bas
/
asilib11
/
input.doc
< prev
next >
Wrap
Text File
|
1994-10-22
|
7KB
|
224 lines
******************************** INPUT ************************************
ASILIB Input subroutines (C) Copyright 1994 Douglas Herr
All rights reserved
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
CLEARKEY: clears the keyboard's 'type-ahead' buffer
Parameters: None.
Uses BIOS functions to remove all keys in the buffer.
Supports: Standard and Enhanced keyboards.
Example:
call sub "clearkey"
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
GETKEY: returns next key pressed
Parameters: No input parameters; returns ASCII keycode of first key
pressed.
If keycode < 255, then a normal key was pressed. If the
keycode > 255, then an extended key such as an F-key or
one of the cursor keys was pressed. If an extended key
was pressed, the ASCII code of the key is (keycode - 256).
Uses BIOS functions; supports enhanced keyboard if present.
Example:
call sub "getkey", keycode
REM check for extended key
if keycode > 255 then
REM do instructions here if extended key
REM etc.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
HIDEMOUSE: Makes mouse cursor disappear
Parameters: None.
Makes the mouse cursor disappear. The mouse driver continues
to track the mouse's motion and button status.
Restrictions: Must call ISMOUSE before using this subroutine.
Example:
call sub "hidemouse"
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
JANEIN: German language version of "YesNo"
waits for "J" or "N" key to be pressed
Parameters: No input parameters; returns "J" or "N" keycode.
Key pressed may be upper or lower case. Upper case is
always returned.
Example:
call sub "janein", keycode
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
KEYIFWAITING:Returns first key if one is waiting in the keyboard buffer,
or returns with no keycode if no keypress is waiting.
Parameters: keycode
Returns keycode = 0 if no key is waiting in the keyboard
buffer, otherwise returns the key's ASCII keycode.
Example:
call sub "keyifwaiting", keycode
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
KEYWAITING: Determines if a key is waiting in the keyboard buffer.
Parameters: No input parameters; returns keycode = 0 if no keys in buffer,
keycode = 1 if one or more keys are available in the buffer.
Does not remove the key code from the buffer; uses BIOS.
Supports: Standard and enhanced keyboards.
Example:
call sub "keywaiting", keycode
REM check to see if a key has been pressed
if keycode > 0 then
REM etc.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
KEYORBUTTON: Returns first key pressed or mouse button pressed
Parameters: No input parameters; returns buttoncode and keycode.
Returns first key pressed or mouse button pressed. If no key
is waiting in the keyboard buffer and no mouse button is
pressed, KEYORBUTTON waits until one of these events happens.
If a key is waiting in the keyboard buffer before KEYORBUTTON
is called, the key is returned to the calling program without
checking mouse buttons. Buttoncode = 0 if a key has been read,
otherwise buttoncode indicates which buttons are pressed. See
GETKEY for key codes.
Buttoncodes are:
1 = left button pressed
2 = right button pressed
4 = center button pressed
Note that more than one button may be pressed at the same
time. For example, buttoncode = (2 OR 4) if the right and
center buttons are both pressed.
Example:
call sub "keyorbutton", buttoncode, keycode
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
MOUSESTATUS: determine mouse position and button status
Parameters: No input parameters; returns x and y coordinates and buttoncode.
Returns the mouse button status and mouse position.
Buttoncode is a code which indicates which mouse buttons,
if any, are pressed, and x & y are the PIXEL coordinates of
the mouse cursor, even in text modes. Pixel coordinates start
with (0,0) in the upper left corner. X-coordinates are
horizontal and Y-coordinates are vertical (increasing from
top of screen to bottom). See KEYORBUTTON to decode buttoncode.
Example:
call sub "mousestatus", x, y, buttoncode
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
OUINON: French language version of "YesNo"
waits for "O" or "N" key to be pressed
Parameters: No input parameters; returns keycode = ASC("O") or
ASC("N").
Key pressed may be upper or lower case. Upper case is
returned. Uses BIOS functions.
Example:
call sub "ouinon", keycode
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
SHOWMOUSE: make mouse cursor visible on screen
Parameters: None
Restrictions: Must call ISMOUSE before using this subroutine.
Example:
call sub "showmouse"
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
SINO: Spanish language version of "YesNo"
Parameters: No input parameters; returns keycode = ASC("S")
or ASC("N").
Waits for "S" or "N" key to be pressed. Key pressed may
be upper or lower case; upper case is always returned.
Uses BIOS functions
Example:
call sub "sino", keycode
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
YESNO: Waits for "Y" or "N" key to be pressed
Parameters: No input parameters; returns keycode = ASCII code for "Y"
or "N". Key pressed may be upper or lower case; upper case
keycode is returned. Uses BIOS functions.
Example:
call sub "yesno", keycode