[ Previous | Next | Contents | Glossary | Home | Search ]
GL3.2 for AIX: Graphics Library (GL) Technical Reference

getbutton Subroutine

Purpose

Returns the state (up or down) of a button.

Libraries

Graphics Library

C (libgl.a)

FORTRAN (libfgl.a)

C Syntax

Int32 getbutton(Device number)

FORTRAN Syntax

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.

Description

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.

Parameter

number Specifies the number of the button to test.

Return Values

The return values and their corresponding states are as follows:

Value State
0 Up
1 Down
-1 Invalid device number

Example

The example C language program scrn_rotate.c uses the getbutton subroutine to check the state of various buttons.

Implementation Specifics

This subroutine is part of GL in the AIXwindows Environment/6000 Version 1, Release 2 with AIXwindows/3D Feature.

Files

/usr/include/gl/gl.h Contains C language constant and variable type definitions for GL.
/usr/include/gl/fgl.h Contains FORTRAN constant and variable type definitions for GL.
/usr/include/gl/device.h Contains C language constant and variable type definitions for GL.
/usr/include/gl/fdevice.h Contains FORTRAN constant and variable type definitions for GL.

Related Information

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.


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