Make the raw keyboard code #ifdef WSDISPLAY_COMPAT_RAWKBD only.

This commit is contained in:
martin 2005-05-16 18:28:28 +00:00
parent 4b50e3295a
commit 6230b25cf8
2 changed files with 18 additions and 12 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: kbd.c,v 1.46 2005/05/16 16:23:57 martin Exp $ */
/* $NetBSD: kbd.c,v 1.47 2005/05/16 18:28:28 martin Exp $ */
/*
* Copyright (c) 1992, 1993
@ -47,7 +47,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.46 2005/05/16 16:23:57 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.47 2005/05/16 18:28:28 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -74,10 +74,6 @@ __KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.46 2005/05/16 16:23:57 martin Exp $");
#include <dev/sun/kbd_xlate.h>
#include <dev/sun/kbdvar.h>
#if NWSKBD > 0
#include "opt_wsdisplay_compat.h"
#endif
#include "locators.h"
extern struct cfdriver kbd_cd;
@ -953,16 +949,20 @@ static void
kbd_input_wskbd(struct kbd_softc *k, int code)
{
int type, key;
u_char buf;
#ifdef WSDISPLAY_COMPAT_RAWKBD
if (k->k_wsraw) {
u_char buf;
buf = code;
wskbd_rawinput(k->k_wskbd, &buf, 1);
} else {
type = KEY_UP(code) ? WSCONS_EVENT_KEY_UP : WSCONS_EVENT_KEY_DOWN;
key = KEY_CODE(code);
wskbd_input(k->k_wskbd, type, key);
return;
}
#endif
type = KEY_UP(code) ? WSCONS_EVENT_KEY_UP : WSCONS_EVENT_KEY_DOWN;
key = KEY_CODE(code);
wskbd_input(k->k_wskbd, type, key);
}
int

View File

@ -1,4 +1,4 @@
/* $NetBSD: kbdvar.h,v 1.16 2005/05/16 16:23:57 martin Exp $ */
/* $NetBSD: kbdvar.h,v 1.17 2005/05/16 18:28:28 martin Exp $ */
/*
* Copyright (c) 1992, 1993
@ -44,6 +44,10 @@
#include <dev/wscons/wsconsio.h>
#include <dev/wscons/wskbdvar.h>
#if NWSKBD > 0
#include "opt_wsdisplay_compat.h"
#endif
struct kbd_softc {
struct device k_dev; /* required first: base device */
@ -57,7 +61,9 @@ struct kbd_softc {
#if NWSKBD > 0
struct device * k_wskbd;/* handle for wskbd, if it is attached */
int k_wsenabled; /* set if we are using wskbd */
#ifdef WSDISPLAY_COMPAT_RAWKBD
int k_wsraw; /* send raw events to wscons */
#endif
struct callout k_wsbell;/* to shut the bell off */
#endif