home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a120 / 1.ddi / API / KEYCODE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-24  |  2.0 KB  |  82 lines

  1. /*------------------------------------------------------------------*/
  2. /* KEYCODE.C                                                        */
  3. /*------------------------------------------------------------------*/
  4. /* API ▒`  ªí : 1. detecting()    ( in keycode.c )                  */
  5. /*              2. undetecting()  ( in keycode.c )                  */
  6. /* API ¿τ╝╞└] : keycode.plb                                         */
  7. /* ⌐IÑsñΦªí   : SET LIBRARY TO KEYCODE ( ⌐IÑs DETECTING() )         */
  8. /*              SET LIBRARY TO         ( ⌐IÑs UNDETECTING() )       */
  9. /*------------------------------------------------------------------*/
  10. #include <pro_ext.h>
  11.  
  12. int         eventid;
  13.  
  14.  
  15. FAR EventHandler(WHandle theWindow, EventRec FAR *ev)
  16. {
  17.  
  18.  
  19.     switch(ev->what)
  20.     {
  21.  
  22.         case keyDownEvent:
  23.             if (ev->modifiers & shiftCodeMask)   /* ñ@¡╙╜╒╕`┴Σ│Q½÷ñU */
  24.             {
  25.                 if (ev->modifiers & altKey)      /* Alt ┴Σ  */
  26.  
  27.                     _PutStr("Alt ┴Σñº½÷┴Σ╜X└│╕╙│Q¿╧Ñ╬\n");
  28.  
  29.                 else
  30.                     if (ev->modifiers & ctrlKey) /* Ctrl ┴Σ  */
  31.  
  32.                         _PutStr("Ctrl ┴Σñº½÷┴Σ╜X└│╕╙│Q¿╧Ñ╬\n");
  33.  
  34.                     else
  35.                         if (ev->modifiers & shiftKey)    /* Shift ┴Σ */
  36.  
  37.                             _PutStr("Shift ┴Σñº½÷┴Σ╜X└│╕╙│Q¿╧Ñ╬\n");
  38.             }
  39.             else                                 /* Ñ╝½÷ñU╜╒╕`┴Σ */
  40.                 _PutStr("Ñ┐│W½÷┴Σñº½÷┴Σ╜X└│╕╙│Q¿╧Ñ╬\n");
  41.  
  42.             return NO;
  43.             break;
  44.  
  45.  
  46.  
  47.         default:
  48.             return NO;
  49.     }
  50.     return YES;
  51. }
  52.  
  53. FAR Detecting()
  54. {
  55.  
  56.     eventid = _ActivateHandler(EventHandler);
  57.  
  58. }
  59.  
  60.  
  61.  
  62. FAR Undetecting()
  63. {
  64.  
  65.     _DeActivateHandler(eventid);
  66.  
  67. }
  68.  
  69.  
  70. FoxInfo myFoxInfo[] =
  71. {
  72.     {"DETECTING", Detecting, CALLONLOAD, ""},
  73.     {"UNDETECTING", Undetecting, CALLONUNLOAD, ""}
  74. };
  75.  
  76. FoxTable _FoxTable =
  77. {
  78.     (FoxTable FAR *)0,
  79.     sizeof(myFoxInfo) / sizeof(FoxInfo),
  80.     myFoxInfo
  81. };
  82.