Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/wscons -rename the "KS_GROUP_Ascii" key symbol categ...
details: https://anonhg.NetBSD.org/src/rev/761bc46f507a
branches: trunk
changeset: 751228:761bc46f507a
user: drochner <drochner%NetBSD.org@localhost>
date: Thu Jan 28 22:36:19 2010 +0000
description:
-rename the "KS_GROUP_Ascii" key symbol category to "Plain" because
this is what it meant all the time -- it includes characters >127
-delegate translation of all key symbols >127 to the terminal emulation
layer -- formerly everything non-special was passed to the tty subsystem
directly, involving truncation to a "char", which effectively meant
some ISO-1 assumption
diffstat:
sys/dev/wscons/wsdisplay.c | 8 ++++----
sys/dev/wscons/wsemul_dumb.c | 13 +++++++++++--
sys/dev/wscons/wsemul_sun.c | 11 +++++++++--
sys/dev/wscons/wsemul_vt100_keys.c | 10 ++++++++--
sys/dev/wscons/wskbd.c | 12 ++++++------
sys/dev/wscons/wskbdutil.c | 6 +++---
sys/dev/wscons/wsksymdef.h | 6 +++---
7 files changed, 44 insertions(+), 22 deletions(-)
diffs (246 lines):
diff -r 59b4663514a2 -r 761bc46f507a sys/dev/wscons/wsdisplay.c
--- a/sys/dev/wscons/wsdisplay.c Thu Jan 28 21:38:29 2010 +0000
+++ b/sys/dev/wscons/wsdisplay.c Thu Jan 28 22:36:19 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wsdisplay.c,v 1.127 2010/01/08 19:51:11 dyoung Exp $ */
+/* $NetBSD: wsdisplay.c,v 1.128 2010/01/28 22:36:19 drochner Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.127 2010/01/08 19:51:11 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.128 2010/01/28 22:36:19 drochner Exp $");
#include "opt_wsdisplay_compat.h"
#include "opt_wsmsgattrs.h"
@@ -1672,13 +1672,13 @@
tp = scr->scr_tty;
- if (KS_GROUP(ks) == KS_GROUP_Ascii)
+ if (KS_GROUP(ks) == KS_GROUP_Plain && KS_VALUE(ks) <= 0x7f)
(*tp->t_linesw->l_rint)(KS_VALUE(ks), tp);
else if (WSSCREEN_HAS_EMULATOR(scr)) {
count = (*scr->scr_dconf->wsemul->translate)
(scr->scr_dconf->wsemulcookie, ks, &dp);
while (count-- > 0)
- (*tp->t_linesw->l_rint)(*dp++, tp);
+ (*tp->t_linesw->l_rint)((unsigned char)(*dp++), tp);
}
}
diff -r 59b4663514a2 -r 761bc46f507a sys/dev/wscons/wsemul_dumb.c
--- a/sys/dev/wscons/wsemul_dumb.c Thu Jan 28 21:38:29 2010 +0000
+++ b/sys/dev/wscons/wsemul_dumb.c Thu Jan 28 22:36:19 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wsemul_dumb.c,v 1.14 2006/11/16 01:33:31 christos Exp $ */
+/* $NetBSD: wsemul_dumb.c,v 1.15 2010/01/28 22:36:19 drochner Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wsemul_dumb.c,v 1.14 2006/11/16 01:33:31 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsemul_dumb.c,v 1.15 2010/01/28 22:36:19 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -43,6 +43,7 @@
#include <dev/wscons/wsdisplayvar.h>
#include <dev/wscons/wsemulvar.h>
#include <dev/wscons/ascii.h>
+#include <dev/wscons/wsksymdef.h>
void *wsemul_dumb_cnattach(const struct wsscreen_descr *, void *,
int, int, long);
@@ -203,6 +204,14 @@
wsemul_dumb_translate(void *cookie, keysym_t in,
const char **out)
{
+ static char c;
+
+ if (KS_GROUP(in) == KS_GROUP_Plain) {
+ /* allow ISO-1 */
+ c = KS_VALUE(in);
+ *out = &c;
+ return (1);
+ }
return (0);
}
diff -r 59b4663514a2 -r 761bc46f507a sys/dev/wscons/wsemul_sun.c
--- a/sys/dev/wscons/wsemul_sun.c Thu Jan 28 21:38:29 2010 +0000
+++ b/sys/dev/wscons/wsemul_sun.c Thu Jan 28 22:36:19 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wsemul_sun.c,v 1.26 2006/11/16 01:33:31 christos Exp $ */
+/* $NetBSD: wsemul_sun.c,v 1.27 2010/01/28 22:36:19 drochner Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@@ -33,7 +33,7 @@
/* XXX DESCRIPTION/SOURCE OF INFORMATION */
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wsemul_sun.c,v 1.26 2006/11/16 01:33:31 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsemul_sun.c,v 1.27 2010/01/28 22:36:19 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -545,6 +545,13 @@
{
static char c;
+ if (KS_GROUP(in) == KS_GROUP_Plain) {
+ /* allow ISO-1 */
+ c = KS_VALUE(in);
+ *out = &c;
+ return (1);
+ }
+
if (KS_GROUP(in) == KS_GROUP_Keypad && (in & 0x80) == 0) {
c = in & 0xff; /* turn into ASCII */
*out = &c;
diff -r 59b4663514a2 -r 761bc46f507a sys/dev/wscons/wsemul_vt100_keys.c
--- a/sys/dev/wscons/wsemul_vt100_keys.c Thu Jan 28 21:38:29 2010 +0000
+++ b/sys/dev/wscons/wsemul_vt100_keys.c Thu Jan 28 22:36:19 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wsemul_vt100_keys.c,v 1.9 2005/12/11 12:24:12 christos Exp $ */
+/* $NetBSD: wsemul_vt100_keys.c,v 1.10 2010/01/28 22:36:19 drochner Exp $ */
/*
* Copyright (c) 1998
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100_keys.c,v 1.9 2005/12/11 12:24:12 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsemul_vt100_keys.c,v 1.10 2010/01/28 22:36:19 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -87,6 +87,12 @@
struct wsemul_vt100_emuldata *edp = cookie;
static char c;
+ if (KS_GROUP(in) == KS_GROUP_Plain) {
+ /* catch ISO-1 */
+ c = KS_VALUE(in);
+ *out = &c;
+ return (1);
+ }
if (in >= KS_f1 && in <= KS_f20) {
*out = vt100_fkeys[in - KS_f1];
return (5);
diff -r 59b4663514a2 -r 761bc46f507a sys/dev/wscons/wskbd.c
--- a/sys/dev/wscons/wskbd.c Thu Jan 28 21:38:29 2010 +0000
+++ b/sys/dev/wscons/wskbd.c Thu Jan 28 22:36:19 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wskbd.c,v 1.125 2010/01/13 05:08:24 macallan Exp $ */
+/* $NetBSD: wskbd.c,v 1.126 2010/01/28 22:36:19 drochner Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@@ -105,7 +105,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wskbd.c,v 1.125 2010/01/13 05:08:24 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wskbd.c,v 1.126 2010/01/28 22:36:19 drochner Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -761,7 +761,7 @@
if (sc->sc_base.me_dispdv != NULL)
for (i = 0; i < len; i++)
wsdisplay_kbdinput(sc->sc_base.me_dispdv, tbuf[i]);
- /* this is KS_GROUP_Ascii */
+ /* this is KS_GROUP_Plain */
#endif
}
#endif /* WSDISPLAY_COMPAT_RAWKBD */
@@ -1392,7 +1392,7 @@
for(;;) {
if (num-- > 0) {
ks = wskbd_console_data.t_symbols[pos++];
- if (KS_GROUP(ks) == KS_GROUP_Ascii)
+ if (KS_GROUP(ks) == KS_GROUP_Plain)
return (KS_VALUE(ks));
} else {
(*wskbd_console_data.t_consops->getc)
@@ -1794,7 +1794,7 @@
res = KS_voidSymbol;
switch (KS_GROUP(ksym)) {
- case KS_GROUP_Ascii:
+ case KS_GROUP_Plain:
case KS_GROUP_Keypad:
case KS_GROUP_Function:
res = ksym;
@@ -1835,7 +1835,7 @@
update_leds(id);
/* We are done, return the symbol */
- if (KS_GROUP(res) == KS_GROUP_Ascii) {
+ if (KS_GROUP(res) == KS_GROUP_Plain) {
if (MOD_ONESET(id, MOD_ANYCONTROL)) {
if ((res >= KS_at && res <= KS_z) || res == KS_space)
res = res & 0x1f;
diff -r 59b4663514a2 -r 761bc46f507a sys/dev/wscons/wskbdutil.c
--- a/sys/dev/wscons/wskbdutil.c Thu Jan 28 21:38:29 2010 +0000
+++ b/sys/dev/wscons/wskbdutil.c Thu Jan 28 22:36:19 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wskbdutil.c,v 1.16 2009/04/06 17:32:09 mkirby Exp $ */
+/* $NetBSD: wskbdutil.c,v 1.17 2010/01/28 22:36:19 drochner Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wskbdutil.c,v 1.16 2009/04/06 17:32:09 mkirby Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wskbdutil.c,v 1.17 2010/01/28 22:36:19 drochner Exp $");
#include <sys/param.h>
#include <sys/errno.h>
@@ -354,7 +354,7 @@
if (ksym >= KS_f1 && ksym <= KS_f20)
return(KS_F1 - KS_f1 + ksym);
- if (KS_GROUP(ksym) == KS_GROUP_Ascii && ksym <= 0xff &&
+ if (KS_GROUP(ksym) == KS_GROUP_Plain && ksym <= 0xff &&
latin1_to_upper[ksym] != 0x00)
return(latin1_to_upper[ksym]);
diff -r 59b4663514a2 -r 761bc46f507a sys/dev/wscons/wsksymdef.h
--- a/sys/dev/wscons/wsksymdef.h Thu Jan 28 21:38:29 2010 +0000
+++ b/sys/dev/wscons/wsksymdef.h Thu Jan 28 22:36:19 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wsksymdef.h,v 1.63 2009/04/06 17:32:09 mkirby Exp $ */
+/* $NetBSD: wsksymdef.h,v 1.64 2010/01/28 22:36:19 drochner Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -601,7 +601,7 @@
#define KS_GROUP_Command 0xf400U
#define KS_GROUP_Internal 0xf500U
#define KS_GROUP_Dead 0xf801U /* not encoded in keysym */
-#define KS_GROUP_Ascii 0xf802U /* not encoded in keysym */
+#define KS_GROUP_Plain 0xf802U /* not encoded in keysym */
#define KS_GROUP_Keycode 0xf803U /* not encoded in keysym */
#define KS_NUMKEYCODES 0x1000
@@ -610,7 +610,7 @@
#define KS_GROUP(k) ((k) >= 0x0300 && (k) < 0x0370 ? KS_GROUP_Dead : \
(((k) & 0xf000) == 0xe000 ? KS_GROUP_Keycode : \
(((k) & 0xf800) == 0xf000 ? ((k) & 0xff00) : \
- KS_GROUP_Ascii)))
+ KS_GROUP_Plain)))
#define KS_VALUE(k) (((k) & 0xf000) == 0xe000 ? ((k) & 0x0fff) : \
(((k) & 0xf800) == 0xf000 ? ((k) & 0x00ff) : (k)))
Home |
Main Index |
Thread Index |
Old Index