home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / X / mit / server / ddx / omron / omronKbd.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-06-29  |  2.9 KB  |  115 lines

  1. /*
  2.  * $XConsortium: omronKbd.h,v 1.1 91/06/29 13:49:02 xguest Exp $
  3.  *
  4.  * Copyright 1991 by OMRON Corporation
  5.  * 
  6.  * Permission to use, copy, modify, distribute, and sell this software and its
  7.  * documentation for any purpose is hereby granted without fee, provided that
  8.  * the above copyright notice appear in all copies and that both that
  9.  * copyright notice and this permission notice appear in supporting
  10.  * documentation, and that the name of OMRON not be used in advertising or
  11.  * publicity pertaining to distribution of the software without specific,
  12.  * written prior permission.  OMRON makes no representations about the
  13.  * suitability of this software for any purpose.  It is provided "as is"
  14.  * without express or implied warranty.
  15.  *
  16.  * OMRON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
  17.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL OMRON
  18.  * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  19.  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  20.  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 
  21.  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  22.  */
  23.  
  24. #ifdef    uniosu
  25. # include <sys/deftbl.t>
  26. #else /* not uniosu */
  27. # ifdef luna88k
  28. #  include <dev/deftbl.t>
  29. # else
  30. #  ifdef luna2
  31. #   include <dev/deftbl.t>
  32. #  else /* uniosb */
  33. #   include <om68kdev/deftbl.t>
  34. #  endif
  35. # endif
  36. #endif
  37.  
  38. #define  XK_KATAKANA
  39. #include "keysym.h"
  40.  
  41. #define KS_KANA        0x1
  42. #define KS_CTRL_L    0x2
  43. #define KS_CTRL_R    0x4
  44. #define KS_META_L    0x8
  45. #define KS_META_R    0x10
  46. #define KS_ALT_L    0x20
  47. #define KS_ALT_R    0x40
  48. #define KS_SUPER_L    0x80
  49. #define KS_SUPER_R    0x100
  50. #define KS_HYPER_L    0x200
  51. #define KS_HYPER_R    0x400
  52.  
  53. #define KANA_KEY    11
  54. #define CAPSLOCK_KEY    14
  55.  
  56. #define MIDDLE_BUTTON    1
  57. #define RIGHT_BUTTON    2
  58.  
  59. #define AREPBUFSZ        32
  60.  
  61. #ifdef luna2
  62. #define osfXK_Insert    0x1004FF63
  63. #define osfXK_Copy      0x1004FF02
  64. #define osfXK_Cut       0x1004FF03
  65. #define osfXK_Paste     0x1004FF04
  66.  
  67. #define KB_JISJIS    0
  68. #define KB_ASCII    1
  69. #define KB_ASCIIJIS    2
  70. #define KB_DEFAULT    3
  71. #endif /* luna2*/
  72.  
  73. #ifndef UNUSE_DRV_TIME 
  74. typedef struct _key_event {
  75.     long    time;            
  76.     unsigned char code;
  77. } key_event;       
  78. #endif
  79.  
  80. typedef    struct    _omronKeyPrvRec {
  81.     /* device control */
  82.     int fd;
  83.     int type;
  84.     int flags;
  85. #ifdef uniosu
  86.     struct termio old_term;
  87. #else
  88.     struct sgttyb old_term;
  89. #endif
  90.     /* ascii control */
  91.     int offset;
  92.     KeybdCtrl keybdCtrl;
  93.     char semiEncodeDef[CODTBSZ];
  94.     char semiEncode[CODTBSZ];
  95.     KeyCode minkey,maxkey; 
  96.     /* kana control */
  97. #ifndef USE_KANA_SWITCH
  98.     int key_state;        /* kana key status */
  99.     char semiKanaEncode[CODTBSZ];
  100.     KeyCode kana_minkey,kana_maxkey; 
  101.     unsigned char kana_offset; 
  102. #endif
  103. }    omronKeyPrv,    *omronKeyPrvPtr;
  104.  
  105. extern int  omronKbdProc();
  106. extern void omronKbdGiveUp();
  107.  
  108. extern void omronKbdEnqueueEvent();
  109. extern unsigned char  *omronKbdGetEvents(); 
  110.  
  111. #ifndef UNUSE_DRV_TIME
  112. extern void omronKbdEnqueueTEvent();
  113. extern key_event *omronKbdGetTEvents(); 
  114. #endif
  115.