home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / msdos / graphics / tcxl.arc / TCXLKEY.H < prev    next >
Text File  |  1988-05-07  |  2KB  |  59 lines

  1.  
  2. /*
  3.    ┌──────────────────────────────────────────────────────────────────────────┐
  4.    │                                                                          │
  5.    │  TCXLKEY.H - TCXL (c) 1987, 1988 by Mike Smedley.                        │
  6.    │                                                                          │
  7.    │  This header file contains function prototypes and definitions for       │
  8.    │  keyboard functions.  Keyboard functions for windowing functions are     │
  9.    │  defined in TCXLWIN.H                                                    │
  10.    │                                                                          │
  11.    └──────────────────────────────────────────────────────────────────────────┘
  12. */
  13.  
  14.  
  15. #if __STDC__
  16. #define _Cdecl
  17. #else
  18. #define _Cdecl cdecl
  19. #endif
  20.  
  21.  
  22. /*---------------------------[ Function Prototypes ]-------------------------*/
  23.  
  24. int      _Cdecl getchf(char *valid);
  25. int      _Cdecl getns(char *str,int max);
  26. void     _Cdecl getxch(int *ch,int *xch);
  27. int      _Cdecl inputsf(char *str,char *fmt);
  28. int      _Cdecl waitkey(void);
  29. int      _Cdecl waitkeyt(int duration);
  30.  
  31.  
  32. /*-------------[ keyboard status codes returned from kbstat() ]--------------*/
  33.  
  34. #define RSHIFT      1                   /*  right shift pressed          */
  35. #define LSHIFT      2                   /*  left shift pressed           */
  36. #define CTRL        4                   /*  <Ctrl> pressed               */
  37. #define ALT         8                   /*  <Alt> pressed                */
  38. #define SCRLOCK     16                  /*  <Scroll Lock> toggled        */
  39. #define NUMLOCK     32                  /*  <Num Lock> toggled           */
  40. #define CAPSLOCK    64                  /*  <Caps Lock> toggled          */
  41. #define INS         128                 /*  <Ins> toggled                */
  42.  
  43.  
  44. /*---------------[ seg,ofs address of keyboard status flag ]-----------------*/
  45.  
  46. #define KBFLAG      0,0x417
  47.  
  48.  
  49. /*-----------------------[ macro-function definitions ]-----------------------*/
  50.  
  51. #define capsoff()           poke(KBFLAG,peek(KBFLAG)&191)
  52. #define capson()            poke(KBFLAG,peek(KBFLAG)|64)
  53. #define clearkeys()         while(kbhit()) getch()
  54. #define kbstat()            peek(KBFLAG)
  55. #define numoff()            poke(KBFLAG,peek(KBFLAG)&223)
  56. #define numon()             poke(KBFLAG,peek(KBFLAG)|32)
  57. #define prompts(pr,st)      printf("%s",pr);gets(st)
  58.  
  59.