next up previous contents index
Next: Prompt/Echo Types and Up: Graphical Input Previous: Graphical Input

Logical Input Devices

GKS organizes data that can be input to an applications program into six types, each related to a Logical Input Device. The actual physical input devices are mapped onto these logical devices, which makes it possible for GKS to organize the different forms of data in a device-independent way, and thus helps to make the code more portable. A logical input device is identified by 3 items:

  1. a workstation identifier
  2. an input class
  3. a device number
The six input classes and the logical input values they provide are:
LOCATOR

Returns a position (an x,y value) in World Coordinates and a Normalization Transformation number corresponding to that used to map back from Normalized Device Coordinates to World Coordinates. The NT used corresponds to that viewport with the highest Viewport Input Priority (set by calling GSVPIP). Warning: If there is no viewport input priority set then NT 0 is used as default, in which case the coordinates are returned in NDC. This may not be what is expected!

CALL GSVPIP(TNR, RTNR, RELPRI)
TNR
Transformation Number
RTNR
Reference Transformation Number
RELPRI
One of the values 'GHIGHR' or 'GLOWER' defined in the Include File, ENUM.INC, which is listed in the Appendix on Page gif.
STROKE

Returns a sequence of (x,y) points in World Coordinates and a Normalization Transformation as for the Locator.

VALUATOR

Returns a real value, for example, to control some sort of analogue device.

CHOICE

Returns a non-negative integer which represents a choice from a selection of several possibilities. This could be implemented as a menu, for example.

STRING

Returns a string of characters from the keyboard.

PICK

Returns a segment name and a pick identifier of an object pointed at by the user. Thus, the application does not have to use the locator to return a position, and then try to find out to which object the position corresponds.



next up previous contents index
Next: Prompt/Echo Types and Up: Graphical Input Previous: Graphical Input


Janne Saarela
Mon Apr 3 17:00:12 METDST 1995