Capslock support from Steve Brown <sbrown@best.com>

This commit is contained in:
briggs 1997-04-14 01:02:47 +00:00
parent 13175a1a16
commit 90754f0770
1 changed files with 8 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ite.c,v 1.33 1997/04/08 04:47:08 briggs Exp $ */
/* $NetBSD: ite.c,v 1.34 1997/04/14 01:02:47 briggs Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -174,6 +174,8 @@ struct tty *ite_tty; /* Our tty */
static void (*putpixel) __P((int x, int y, int *c, int num));
static void (*reversepixel) __P((int x, int y, int num));
/* For capslock key functionality */
#define isealpha(ch) (((ch)>='A'&&(ch)<='Z')||((ch)>='a'&&(ch)<='z')||((ch)>=0xC0&&(ch)<=0xFF))
/*
* Bitmap handling functions
@ -1142,7 +1144,7 @@ itestop(struct tty * tp, int flag)
int
ite_intr(adb_event_t * event)
{
static int shift = 0, control = 0;
static int shift = 0, control = 0, capslock = 0;
int key, press, val, state;
char str[10], *s;
@ -1152,6 +1154,8 @@ ite_intr(adb_event_t * event)
if (val == ADBK_SHIFT)
shift = press;
else if (val == ADBK_CAPSLOCK)
capslock = !capslock;
else if (val == ADBK_CONTROL)
control = press;
else if (press) {
@ -1182,6 +1186,8 @@ ite_intr(adb_event_t * event)
break;
default:
state = 0;
if (capslock && isealpha(keyboard[val][1]))
state = 1;
if (shift)
state = 1;
if (control)