Returns the state (up or down) of a button.
FORTRAN (libfgl.a)
Int32 getbutton(Device number)
LOGICAL FUNCTION GETBUT(number) INTEGER*4 number
Note: For FORTRAN users, this function accepts long integer parameters (INTEGER*4) when invoked from a FORTRAN program, although it accepts short integers when invoked from a C program. The C and FORTRAN syntax shown here reflect this difference.
The getbutton subroutine returns the state of the button specified in the number parameter. A complete list of buttons can be found in the file /usr/include/gl/device.h.
Note: This subroutine cannot be used to add to a display list.
number | Specifies the number of the button to test. |
The return values and their corresponding states are as follows:
Value | State |
0 | Up |
1 | Down |
-1 | Invalid device number |
The example C language program scrn_rotate.c uses the getbutton subroutine to check the state of various buttons.
This subroutine is part of GL in the AIXwindows Environment/6000 Version 1, Release 2 with AIXwindows/3D Feature.
Returning the current state of a valuator with the getvaluator subroutine.
AIX Graphics Library Overview, Controlling Queues and Devices, Using the Keyboard, and Querying the System.