Interactive Routines.


getkey()

Return the ASCII ordinal of the next key typed at the keyboard. If the device has no keyboard getkey returns -1.

    Fortran:
         integer function getkey
    C:
         int getkey()

    Pascal:
         function GetKey(): integer;

checkkey()

Returns zero if no key is pressed or the ASCII ordinal of the key that was pressed.

    Fortran:
         integer function checkkey()
    C:
         int checkkey()

    Pascal:
         function CheckKey(): integer;

getstring(bcol, string)

Read in a string, echoing it in the current font, using the current color and the current transformation. bcol is the background color which is used for erasing characters after a backspace or a delete key is received. Getstring interprets the Backspace key (ASCII 8) and the Del key (ASCII 127) as erasing characters. An EOT (ASCII 4) or a Carriage return (ASCII 13) will terminate input. Getstring returns the number of characters read. Getstring does not check for overflow in the input buffer string

    Fortran:
         integer function getstring(bcol, string)
         integer bcol
         character *(*) string
    C:
         int getstring(bcol, string)
              int  bcol;
              char *string;

    Pascal:
function GetString(bcol: integer; var string: string_t): integer;

locator(xaddr, yaddr)

Find out where the cursor is. xaddr and yaddr are set to the current location in world coordinates. The function returns a bit pattern which indicates which buttons are being held down eg. if mouse buttons 1 and 3 are down locator returns binary 101 (decimal 7). The function returns -1 if the device has no locator capability. Note: if you have been doing a lot of 3-D transformations xaddr and yaddr may not make a lot of sense. In this case use slocator.

    Fortran:
         integer function locator(xaddr, yaddr)
         real xaddr, yaddr
    C:
         int locator(xaddr, yaddr)
              float     *xaddr, *yaddr;

    Pascal:
         function Locator(var xaddr, yaddr: real): integer;

slocator(xaddr, yaddr)

Find out where the cursor is. xaddr and yaddr are set to the current location in screen coordinates. The return value of the function is set up in the same way as with locator. If the device has no locator device slocator returns -1.

    Fortran:
         integer function slocator(xaddr, yaddr)
         real xaddr, yaddr
    C:
         int slocator(xaddr, yaddr)
              float     *xaddr, *yaddr;

    Pascal:
         function Slocator(var xaddr, yaddr: real): integer;