diff options
Diffstat (limited to 'sys/isa/syscons.c')
-rw-r--r-- | sys/isa/syscons.c | 62 |
1 files changed, 58 insertions, 4 deletions
diff --git a/sys/isa/syscons.c b/sys/isa/syscons.c index 56feb74653b1..85dbdc95acb3 100644 --- a/sys/isa/syscons.c +++ b/sys/isa/syscons.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: syscons.c,v 1.241 1997/12/06 13:23:26 bde Exp $ + * $Id: syscons.c,v 1.242 1997/12/07 08:09:19 yokota Exp $ */ #include "sc.h" @@ -127,6 +127,7 @@ static int blinkrate = 0; char crtc_type = KD_MONO; char crtc_vga = FALSE; static u_char shfts = 0, ctls = 0, alts = 0, agrs = 0, metas = 0; +static u_char accents = 0; static u_char nlkcnt = 0, clkcnt = 0, slkcnt = 0, alkcnt = 0; static const u_int n_fkey_tab = sizeof(fkey_tab) / sizeof(*fkey_tab); static int delayed_next_scr = FALSE; @@ -635,7 +636,7 @@ fail: static int scresume(void *dummy) { - shfts = ctls = alts = agrs = metas = 0; + shfts = ctls = alts = agrs = metas = accents = 0; return 0; } #endif @@ -1767,7 +1768,7 @@ scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) case K_XLATE: /* switch to XLT ascii mode */ if (scp == cur_console && scp->status & KBD_RAW_MODE) - shfts = ctls = alts = agrs = metas = 0; + shfts = ctls = alts = agrs = metas = accents = 0; scp->status &= ~(KBD_RAW_MODE | KBD_CODE_MODE); return 0; default: @@ -1867,9 +1868,20 @@ scioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) return 0; case PIO_KEYMAP: /* set keyboard translation table */ + accents = 0; + bzero(&accent_map, sizeof(accent_map)); bcopy(data, &key_map, sizeof(key_map)); return 0; + case GIO_DEADKEYMAP: /* get accent key translation table */ + bcopy(&accent_map, data, sizeof(accent_map)); + return 0; + + case PIO_DEADKEYMAP: /* set accent key translation table */ + accents = 0; + bcopy(data, &accent_map, sizeof(accent_map)); + return 0; + case PIO_FONT8x8: /* set 8x8 dot font */ if (!crtc_vga) return ENXIO; @@ -2349,7 +2361,7 @@ exchange_scr(void) load_palette(palette); if (old_scp->status & KBD_RAW_MODE || new_scp->status & KBD_RAW_MODE || old_scp->status & KBD_CODE_MODE || new_scp->status & KBD_CODE_MODE) - shfts = ctls = alts = agrs = metas = 0; + shfts = ctls = alts = agrs = metas = accents = 0; set_border(new_scp->border); update_leds(new_scp->status); delayed_next_scr = FALSE; @@ -3695,20 +3707,24 @@ next_code: break; case SPSC: #ifdef SC_SPLASH_SCREEN + accents = 0; toggle_splash_screen(cur_console); #endif break; case RBT: + accents = 0; shutdown_nice(); break; case SUSP: #if NAPM > 0 + accents = 0; apm_suspend(); #endif break; case DBG: #ifdef DDB /* try to switch to console 0 */ + accents = 0; if (cur_console->smode.mode == VT_AUTO && console[0]->smode.mode == VT_AUTO) switch_scr(cur_console, 0); @@ -3754,8 +3770,21 @@ next_code: } break; case BTAB: + accents = 0; return(BKEY); default: + if (action >= F_ACC && action <= L_ACC) { + accents = action - F_ACC + 1; + if (accent_map.acc[accents - 1].accchar == 0) { + accents = 0; + do_bell(cur_console, BELL_PITCH, BELL_DURATION); + } + break; + } + if (accents > 0) { + accents = 0; + do_bell(cur_console, BELL_PITCH, BELL_DURATION); + } if (action >= F_SCR && action <= L_SCR) { switch_scr(cur_console, action - F_SCR); break; @@ -3766,6 +3795,31 @@ next_code: } } else { + if (accents) { + struct acc_t *acc; + int i; + + acc = &accent_map.acc[accents - 1]; + accents = 0; + if (action == ' ') { + action = acc->accchar; + if (metas) + action |= MKEY; + return (action); + } + for (i = 0; i < NUM_ACCENTCHARS; ++i) { + if (acc->map[i][0] == 0) + break; + if (acc->map[i][0] == action) { + action = acc->map[i][1]; + if (metas) + action |= MKEY; + return (action); + } + } + do_bell(cur_console, BELL_PITCH, BELL_DURATION); + goto next_code; + } if (metas) action |= MKEY; return(action); |