C Language Development Kit/Functions/ShiftState
From OptiWiki
< C Language Development Kit | Functions(Redirected from C Language Development Kit/Functions/Shiftstate)
| Description | shiftstate() sets or returns the state of
the shift mode. Normally the shift mode is toggled between on and off by pressing the shift key, but in some cases it can be very useful if the user can do this in the application program. | ||||||
| Syntax | int shiftstate(int mode); | ||||||
| Arguments | The following values of mode are defined:
int mode
| ||||||
| Returns | The current state of the shift mode. | ||||||
| Remarks | None | ||||||
| Example | #include "lib.h" #include <stdio.h> void main( void ) { setecho( ON ); while( 1 ) { if( kbhit() ) { gotoxy( 0, 0); if( shiftstate( -1 ) == 0) { printf("\fShift is on"); shiftstate( 1 ); resetkey(); } else { printf("\fShift is off"); shiftstate( 0 ); resetkey(); } } idle(); } } |
