[ Previous | Next | Contents | Glossary | Home | Search ]
The graPHIGS Programming Interface : Subroutine Reference

Chapter 10. Input Subroutines

Input subroutines allow users to supply input to your application. There are six logical input device classes: locator, stroke, valuator, choice, pick, and string. There are three modes of interaction with the input devices: sample, request, and event. Input subroutines also allow a program to emulate physical device input for one or more logical devices.

The subroutines discussed in this section perform the following operations:

  • initialization of an input device

  • setting the operating mode of an input device

  • requesting input from a device

  • sampling an input device's current value

  • managing the event queue

  • retrieving input values from the event queue

  • emulating a physical device

  • defining a cursor.
  • To determine the actual input capabilities of a specific workstation, use the inquire subroutines (see Chapter 16. "Inquire Subroutines")

    GPAWEV - Await Event

    GPAWEV (time, major, class, minor)

    Purpose

    Use GPAWEV to move the next event from the event queue into the current event report. If the input queue is empty, the graPHIGS API is placed in a wait state until at least one of the following occurs:

    1. An event is added to the event queue.

    2. The time specified in the timeout parameter has elapsed.

    3. An error is reported by any nucleus connected to the shell.
    4. If the time value is zero, no wait takes place. If the time value is not zero, a wait takes place for the specified time interval. The maximum time interval is 55,800 seconds (15.5 hours)

      The timing is done using the operating system's timing facility. (See The graPHIGS Programming Interface: Writing Applications )

      When a timeout or error situation occurs, the graPHIGS API returns zero for the event class parameter and major/minor code parameters are not set. Otherwise, the graPHIGS API returns the major code, class, and minor code of the event in the current event report. For the details of event class, major/minor codes and event data, see The graPHIGS Programming Interface: Technical Reference

      The application must use the appropriate Get subroutine call to obtain the value(s) of the input residing in the current event report.

      Parameters

      time -- specified by user, short floating-point number

      Timeout interval in seconds (>=0.0)

      major -- returned by the graPHIGS API, fullword integer

      Major event code.

      class -- returned by the graPHIGS API, fullword integer

      Event class.

      minor -- returned by the graPHIGS API, fullword integer

      Minor event code.

      Error Codes

      147
      EVENT QUEUE HAS OVERFLOWED
      151
      TIMEOUT VALUE < ZERO
      168
      INPUT DEVICE IS CURRENTLY OWNED BY ANOTHER CONNECTION
      532
      TIME INTERVAL IS TOO LARGE

      Note:

      The operation is performed even if error 147 occurs.

      Related Subroutines

      GPCHMO
      Set Choice Mode
      GPEVHN
      Define Event Handling Subroutine
      GPFLEV
      Flush Device Event
      GPFWEV
      Flush Workstation Event
      GPGTCH
      Get Choice
      GPGTLC
      Get Locator
      GPGTPK
      Get Pick
      GPGTSK
      Get Stroke
      GPGTST
      Get String
      GPGTVL
      Get Valuator
      GPGTXP
      Get Extended Pick
      GPLCMO
      Set Locator Mode
      GPPKMO
      Set Pick Mode
      GPSBMS
      Send Broadcast Message
      GPSKMO
      Set Stroke Mode
      GPSPMS
      Send Private Message
      GPSSTH
      Set Structure Store Threshold
      GPSTMO
      Set String Mode
      GPQCEV
      Inquire Current Event
      GPQIQO
      Inquire Input Queue Overflow
      GPQSEV
      Inquire More Simultaneous Events

      RCP code

      201338113 (X'0C002D01')


      [ Previous | Next | Contents | Glossary | Home | Search ]