home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 11 Util
/
11-Util.zip
/
UDEL.ZIP
/
SFKB.H
< prev
next >
Wrap
Text File
|
1988-10-09
|
12KB
|
252 lines
/******************************************************************************
* sfkb.h - standart key board routines for microsoft c under OS/2 *
* *
* 07/09/88 *
******************************************************************************/
#define FKEY1 0x3b /* unshifted function keys */
#define FKEY2 0x3c
#define FKEY3 0x3d
#define FKEY4 0x3e
#define FKEY5 0x3f
#define FKEY6 0x40
#define FKEY7 0x41
#define FKEY8 0x42
#define FKEY9 0x43
#define FKEY10 0x44
#define FKEY11 0x85
#define FKEY12 0x86
#define US_FKEY1 0x54 /* Upper shift function keys */
#define US_FKEY2 0x55
#define US_FKEY3 0x56
#define US_FKEY4 0x57
#define US_FKEY5 0x58
#define US_FKEY6 0x59
#define US_FKEY7 0x5a
#define US_FKEY8 0x5b
#define US_FKEY9 0x5c
#define US_FKEY10 0x5d
#define US_FKEY11 0x87
#define US_FKEY12 0x88
#define ALT_FKEY1 0x68 /* alt function key */
#define ALT_FKEY2 0x69
#define ALT_FKEY3 0x6a
#define ALT_FKEY4 0x6b
#define ALT_FKEY5 0x6c
#define ALT_FKEY6 0x6d
#define ALT_FKEY7 0x6e
#define ALT_FKEY8 0x6f
#define ALT_FKEY9 0x70
#define ALT_FKEY10 0x71
#define ALT_FKEY11 0x8b
#define ALT_FKEY12 0x8c
#define CTL_FKEY1 0x5e /* control Function key */
#define CTL_FKEY2 0x5f
#define CTL_FKEY3 0x60
#define CTL_FKEY4 0x61
#define CTL_FKEY5 0x62
#define CTL_FKEY6 0x63
#define CTL_FKEY7 0x64
#define CTL_FKEY8 0x65
#define CTL_FKEY9 0x66
#define CTL_FKEY10 0x67
#define CTL_FKEY11 0x89
#define CTL_FKEY12 0x8a
#define INSERT_K 0x52
#define DELETE_K 0x53
#define HOME_K 0x47
#define END_K 0x4f
#define PAGEUP_K 0x49
#define PAGEDOWN_K 0x51
#define ALT_INSERT_K 0x92 /* ALT */
#define ALT_DELETE_K 0x93
#define ALT_HOME_K 0x77
#define ALT_END_K 0x75
#define ALT_PAGEUP_K 0x84
#define ALT_PAGEDOWN_K 0x76
#define CTL_INSERT_K 0xa2 /* control */
#define CTL_DELETE_K 0xa3
#define CTL_HOME_K 0x97
#define CTL_END_K 0x9f
#define CTL_PAGEUP_K 0x99
#define CTL_PAGEDOWN_K 0xa1
#define UP_K 0x48 /* arrow pad */
#define DOWN_K 0x50
#define RIGHT_K 0x4d
#define LEFT_K 0x4b
#define ALT_UP_K 0x98 /* ALT arrow pad */
#define ALT_DOWN_K 0xa0
#define ALT_RIGHT_K 0x9b
#define ALT_LEFT_K 0x9d
#define CTL_UP_K 0x8d /* CTL arrow pad */
#define CTL_DOWN_K 0x91
#define CTL_RIGHT_K 0x73
#define CTL_LEFT_K 0x74
#define K_WAIT 0 /* wait for key board */
#define K_NO_WAIT 1 /* no key board wait */
/* sfkb_set_shift */
#define K_CAP_LOCK 0x40 /* sfkb_get_shift */
#define K_NUM_LOCK 0x20
#define K_SCROLL_LOCK 0x10
#define K_LEFT_SHIFT 0x02 /* used in sfkb_get_shift ONLY */
#define K_RIGHT_SHIFT 0x01
#define K_ALT 0x08
#define K_CTL 0x04
#define K_ON 1 /* returns of sfkb_get_shift */
#define K_OFF 0
#define K_ECHO_ON 0x01
#define K_ECHO_OFF 0X02
#define K_RAW_MODE 0x04
#define K_COOKED_MODE 0x08
#define K_MODE_ON 0x01
#define K_MODE_OFF 0x00
int sfkb_getch(int *ascii,int *function,int wait);
/****************************************************************************
* sf_getch - passes back the ascii key pressed or function/cursor pad *
* keys, only one will be returned other will be zero. *
* *
* wait : K_WAIT = wait for keyboard input before returning *
* K_NO_WAIT = do not wait for keyboard input before returning *
* *
* fuction return key stroke value or zero if no key pressed. * *
* *
* *
****************************************************************************/
int sfkb_getch_vas(int *ascii,int wait,char *vc);
/****************************************************************************
* sf_getch_vas accept ascii key from list of valid char set *
* vc. *
* *
* wait : K_WAIT = wait for keyboard input before returning *
* K_NO_WAIT = do not wait for keyboard input before returning *
* *
* fuction return key stroked pressed or 0 if none pressed. *
* *
* *
****************************************************************************/
int sfkb_getch_vfs(int *function,int wait,char *fl);
/****************************************************************************
* sf_getch_vfs accept function key from valid set of function keys *
* fl. *
* *
* wait : K_WAIT = wait for keyboard input before returning *
* K_NO_WAIT = do not wait for keyboard input before returning *
* *
* fuction return key stroked pressed or 0 if none pressed. *
* *
* *
****************************************************************************/
int sfkb_getch_vafs(int *ascii,int *function,int wait,char *vc,char *fl);
/****************************************************************************
* sf_getch_vafs accept ascii or function key from valid list of ascii *
* and function keys vc and fl *
* *
* wait : K_WAIT = wait for keyboard input before returning *
* K_NO_WAIT = do not wait for keyboard input before returning *
* *
* fuction return key stroked pressed or 0 if none pressed. *
* *
* *
****************************************************************************/
int sfkb_kbhit(int *ascii,int *function);
/****************************************************************************
* sfkb_kbhit - check for keyboard hit but does not take key of the *
* keystroke of the key board buffer. Will return *
* the ascii or function key. *
* funciton returns 0 for no key stroke *
* 1 for a key stroke *
****************************************************************************/
void sfkb_flush(void);
/******************************************************************************
* sfkb_flush - remove all keystrokes from keyboard buffer *
******************************************************************************/
int sfkb_get_state(int state);
/******************************************************************************
* sfkb_get_state check the status of the keyboard shift/numlock/scroll lock *
* the folowing are valid. *
* K_CAP_LOCK 0x40 *
* K_NUM_LOCK 0x20 *
* K_SCROLL_LOCK 0x10 *
* K_LEFT_SHIFT 0x01 *
* K_RIGHT_SHIFT 0x02 *
* K_ALT 0x08 *
* K_CTL 0x04 *
* returns K_ON or K_OFF *
******************************************************************************/
void sfkb_set_state(int state,int swith);
/******************************************************************************
* sfkb_set_state Set key board to the following state *
* K_CAP_LOCK 0x40 *
* K_NUM_LOCK 0x20 *
* K_SCROLL_LOCK 0x10 *
* with swith *
* K_ON *
* K_OFF *
* *
******************************************************************************/
int sfkb_get_mode(int mode);
/*******************************************************************************
* sfkb_get_mode check keyboard mode return K_MODE_ON or K_MODE_OFF *
* K_ECHO_ON *
* K_ECHO_OFF *
* K_RAW_MODE *
* K_COOKED_MODE *
*******************************************************************************/
void sfkb_set_mode(int mode);
/*******************************************************************************
* sfkb_set_mode set the mode to the folowing *
* K_ECHO_ON *
* K_ECHO_OFF *
* K_RAW_MODE *
* K_COOKED_MODE *
*******************************************************************************/