home *** CD-ROM | disk | FTP | other *** search
- /*
- * EXAMP14.C
- *
- * The Greenleaf Comm Library
- *
- * Copyright (C) 1989 Greenleaf Software Inc. All Rights Reserved.
- *
- * This example program demonstrates the use of the kbshift() routine.
- *
- */
- #include <stdio.h>
- #include <stdlib.h>
- #include "asiports.h"
- #include "ibmkeys.h"
- #include "gf.h"
-
- char *states[]={ "Right shift", "Left shift", "Control", "Alt",
- "Scroll lock", "Num lock", "Caps lock", "Insert mode" };
-
- void main( void );
-
- void main()
- {
- int shift_status;
- int i;
-
- shift_status = kbshift();
- for ( i = 0 ; i < 8 ; i++ ) {
- printf( "%-15s: ", states[ i ] );
- printf( "%s\n", shift_status & 1 ? "ON" : "OFF" );
- shift_status >>= 1;
- }
- }