| version 1.1, 2004/07/14 16:01:40 | version 1.3, 2005/03/12 12:36:57 | 
| Line 10 | Line 10 | 
 | * 2. Redistributions in binary form must reproduce the above copyright | * 2. Redistributions in binary form must reproduce the above copyright | 
 | *    notice, this list of conditions and the following disclaimer in the | *    notice, this list of conditions and the following disclaimer in the | 
 | *    documentation and/or other materials provided with the distribution. | *    documentation and/or other materials provided with the distribution. | 
 | * 3. The name of the author may not be used to endorse or promote products |  | 
 | *    derived from this software without specific prior written permission. |  | 
 | * | * | 
 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | 
 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 
| Line 39 | Line 37 | 
 |  |  | 
 | #define NC      KEYBOARD_KC_NC | #define NC      KEYBOARD_KC_NC | 
 |  |  | 
| static const BYTE xkeyconv_jis[256] = { | static const UINT8 xkeyconv_jis[256] = { | 
 | /*          ,    ,    ,    ,    ,    ,    ,             ; 0x00 */ | /*          ,    ,    ,    ,    ,    ,    ,             ; 0x00 */ | 
 | NC,  NC,  NC,  NC,  NC,  NC,  NC,  NC, | NC,  NC,  NC,  NC,  NC,  NC,  NC,  NC, | 
 | /*          ,    ,    ,    ,    ,    ,    ,             ; 0x08 */ | /*          ,    ,    ,    ,    ,    ,    ,             ; 0x08 */ | 
| Line 106  static const BYTE xkeyconv_jis[256] = { | Line 104  static const BYTE xkeyconv_jis[256] = { | 
 | NC,  NC,  NC,  NC,  NC,  NC,  NC,  NC | NC,  NC,  NC,  NC,  NC,  NC,  NC,  NC | 
 | }; | }; | 
 |  |  | 
| static const BYTE xkeyconv_ascii[256] = { | static const UINT8 xkeyconv_ascii[256] = { | 
 | /*          ,    ,    ,    ,    ,    ,    ,             ; 0x00 */ | /*          ,    ,    ,    ,    ,    ,    ,             ; 0x00 */ | 
 | NC,  NC,  NC,  NC,  NC,  NC,  NC,  NC, | NC,  NC,  NC,  NC,  NC,  NC,  NC,  NC, | 
 | /*          ,    ,    ,    ,    ,    ,    ,             ; 0x08 */ | /*          ,    ,    ,    ,    ,    ,    ,             ; 0x08 */ | 
| Line 173  static const BYTE xkeyconv_ascii[256] = | Line 171  static const BYTE xkeyconv_ascii[256] = | 
 | NC,  NC,  NC,  NC,  NC,  NC,  NC,  NC, | NC,  NC,  NC,  NC,  NC,  NC,  NC,  NC, | 
 | }; | }; | 
 |  |  | 
| static const BYTE xkeyconv_misc[256] = { | static const UINT8 xkeyconv_misc[256] = { | 
 | /*          ,    ,    ,    ,    ,    ,    ,             ; 0x00 */ | /*          ,    ,    ,    ,    ,    ,    ,             ; 0x00 */ | 
 | NC,  NC,  NC,  NC,  NC,  NC,  NC,  NC, | NC,  NC,  NC,  NC,  NC,  NC,  NC,  NC, | 
 | /*        BS, TAB,  LF, CLR,    , RET,    ,             ; 0x08 */ | /*        BS, TAB,  LF, CLR,    , RET,    ,             ; 0x08 */ | 
| Line 240  static const BYTE xkeyconv_misc[256] = { | Line 238  static const BYTE xkeyconv_misc[256] = { | 
 | NC,  NC,  NC,  NC,  NC,  NC,  NC,0x39 | NC,  NC,  NC,  NC,  NC,  NC,  NC,0x39 | 
 | }; | }; | 
 |  |  | 
| static const BYTE *xkeyconv = xkeyconv_jis; | static const UINT8 *xkeyconv = xkeyconv_jis; | 
| static BYTE shift_stat = 0x00; | static UINT8 shift_stat = 0x00; | 
 |  |  | 
 | BOOL | BOOL | 
 | kbdmng_init(void) | kbdmng_init(void) | 
| Line 256  kbdmng_init(void) | Line 254  kbdmng_init(void) | 
 | return SUCCESS; | return SUCCESS; | 
 | } | } | 
 |  |  | 
| static BYTE | static UINT8 | 
| get_data(guint keysym, BYTE down) | get_data(guint keysym, UINT8 down) | 
 | { | { | 
| BYTE data; | UINT8 data; | 
 |  |  | 
 | if (keysym & ~0xff) { | if (keysym & ~0xff) { | 
 | if (keysym == GDK_VoidSymbol) { | if (keysym == GDK_VoidSymbol) { | 
| Line 290  get_data(guint keysym, BYTE down) | Line 288  get_data(guint keysym, BYTE down) | 
 | void | void | 
 | gtkkbd_keydown(guint keysym) | gtkkbd_keydown(guint keysym) | 
 | { | { | 
| BYTE data; | UINT8 data; | 
 |  |  | 
 | data = get_data(keysym, 0x80); | data = get_data(keysym, 0x80); | 
 | if (data != NC) { | if (data != NC) { | 
 | if ((data & 0x80) == 0) { | if ((data & 0x80) == 0) { | 
 | keystat_senddata(data); | keystat_senddata(data); | 
 | } else { | } else { | 
| BYTE s = (shift_stat & 0x80) | 0x70; | UINT8 s = (shift_stat & 0x80) | 0x70; | 
 | keystat_senddata(s); | keystat_senddata(s); | 
 | keystat_senddata(data & 0x7f); | keystat_senddata(data & 0x7f); | 
 | keystat_senddata(s ^ 0x80); | keystat_senddata(s ^ 0x80); | 
| Line 308  gtkkbd_keydown(guint keysym) | Line 306  gtkkbd_keydown(guint keysym) | 
 | void | void | 
 | gtkkbd_keyup(guint keysym) | gtkkbd_keyup(guint keysym) | 
 | { | { | 
| BYTE data; | UINT8 data; | 
 |  |  | 
 | data = get_data(keysym, 0x00); | data = get_data(keysym, 0x00); | 
 | if (data != NC) { | if (data != NC) { |