--- np2/keystat.c 2004/04/02 19:31:26 1.13 +++ np2/keystat.c 2005/02/07 14:46:07 1.17 @@ -5,6 +5,7 @@ #include "iocore.h" #include "keystat.h" #include "keystat.tbl" +#include "softkbd.h" typedef struct { @@ -87,7 +88,7 @@ const KEYNAME *n; const KEYNAME *nterm; n = keyname; - nterm = keyname + (sizeof(keyname) / sizeof(KEYNAME)); + nterm = keyname + NELEMENTS(keyname); while(n < nterm) { if (!milstr_cmp(n->str, str)) { return(n->num); @@ -179,6 +180,9 @@ static void reloadled(void) { keyctrl.kanaref = keystat.ref[0x72]; keyctrl.capsref = keystat.ref[0x71]; +#if defined(SUPPORT_SOFTKBD) + softkbd_led(getledstat()); +#endif } void keystat_ctrlreset(void) { @@ -186,12 +190,13 @@ void keystat_ctrlreset(void) { keyctrl.reqparam = 0; keystat.ref[0x72] = keyctrl.kanaref; keystat.ref[0x71] = keyctrl.capsref; +#if defined(SUPPORT_SOFTKBD) + softkbd_led(getledstat()); +#endif } void keystat_ctrlsend(REG8 dat) { - return; - if (!keyctrl.reqparam) { keyctrl.mode = dat; switch(dat) { @@ -265,10 +270,22 @@ void keystat_down(const UINT8 *key, REG8 keydata = *key++; keycode = (keydata & 0x7f); if (keycode < 0x70) { +#if 1 // 05/02/04 + if (keystat.ref[keycode] != NKEYREF_NC) { + if (!(kbexflag[keycode] & KBEX_NONREP)) { + keyboard_send((REG8)(keycode + 0x80)); + keystat.ref[keycode] = NKEYREF_NC; + } + } + if (keystat.ref[keycode] == NKEYREF_NC) { + keyboard_send(keycode); + } +#else if ((keystat.ref[keycode] == NKEYREF_NC) || (!(kbexflag[keycode] & KBEX_NONREP))) { keyboard_send(keycode); } +#endif keystat.ref[keycode] = ref; } else {