implement a way to get raw keyboard data (for X)
This commit is contained in:
parent
0aa10dad6b
commit
68891be537
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: pckbd.c,v 1.7 1998/05/03 09:57:50 drochner Exp $ */
|
/* $NetBSD: pckbd.c,v 1.8 1998/06/11 22:15:14 drochner Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1993, 1994, 1995 Charles Hannum. All rights reserved.
|
* Copyright (c) 1993, 1994, 1995 Charles Hannum. All rights reserved.
|
||||||
|
@ -68,6 +68,8 @@
|
||||||
|
|
||||||
#include "locators.h"
|
#include "locators.h"
|
||||||
|
|
||||||
|
#include "opt_wsdisplay_compat.h"
|
||||||
|
|
||||||
struct pckbd_internal {
|
struct pckbd_internal {
|
||||||
int t_isconsole;
|
int t_isconsole;
|
||||||
pckbc_tag_t t_kbctag;
|
pckbc_tag_t t_kbctag;
|
||||||
|
@ -87,6 +89,9 @@ struct pckbd_softc {
|
||||||
struct pckbd_internal *id;
|
struct pckbd_internal *id;
|
||||||
|
|
||||||
struct device *sc_wskbddev;
|
struct device *sc_wskbddev;
|
||||||
|
#ifdef WSDISPLAY_COMPAT_RAWKBD
|
||||||
|
int rawkbd;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
static int pckbd_is_console __P((pckbc_tag_t, pckbc_slot_t));
|
static int pckbd_is_console __P((pckbc_tag_t, pckbc_slot_t));
|
||||||
|
@ -408,6 +413,13 @@ pckbd_input(vsc, data)
|
||||||
struct pckbd_softc *sc = vsc;
|
struct pckbd_softc *sc = vsc;
|
||||||
int type, key;
|
int type, key;
|
||||||
|
|
||||||
|
#ifdef WSDISPLAY_COMPAT_RAWKBD
|
||||||
|
if (sc->rawkbd) {
|
||||||
|
char d = data;
|
||||||
|
wskbd_rawinput(sc->sc_wskbddev, &d, 1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (pckbd_decode(sc->id, data, &type, &key))
|
if (pckbd_decode(sc->id, data, &type, &key))
|
||||||
wskbd_input(sc->sc_wskbddev, type, key);
|
wskbd_input(sc->sc_wskbddev, type, key);
|
||||||
}
|
}
|
||||||
|
@ -448,6 +460,11 @@ pckbd_ioctl(v, cmd, data, flag, p)
|
||||||
#endif
|
#endif
|
||||||
#undef d
|
#undef d
|
||||||
return (0);
|
return (0);
|
||||||
|
#ifdef WSDISPLAY_COMPAT_RAWKBD
|
||||||
|
case WSKBDIO_SETMODE:
|
||||||
|
t->t_sc->rawkbd = (*(int *)data == WSKBD_RAW);
|
||||||
|
return (0);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: wsconsio.h,v 1.2 1998/04/07 13:43:17 hannken Exp $ */
|
/* $NetBSD: wsconsio.h,v 1.3 1998/06/11 22:15:14 drochner Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
|
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
|
||||||
|
@ -143,6 +143,12 @@ struct wskbd_string_data {
|
||||||
#define WSKBDIO_GETSTRING _IOR('W', 17, struct wskbd_string_data)
|
#define WSKBDIO_GETSTRING _IOR('W', 17, struct wskbd_string_data)
|
||||||
#define WSKBDIO_SETSTRING _IOW('W', 18, struct wskbd_string_data)
|
#define WSKBDIO_SETSTRING _IOW('W', 18, struct wskbd_string_data)
|
||||||
|
|
||||||
|
/* internal use only */
|
||||||
|
#define WSKBDIO_SETMODE _IOW('W', 19, int)
|
||||||
|
#define WSKBDIO_GETMODE _IOR('W', 20, int)
|
||||||
|
#define WSKBD_TRANSLATED 0
|
||||||
|
#define WSKBD_RAW 1
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mouse ioctls (32 - 63)
|
* Mouse ioctls (32 - 63)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: wskbdvar.h,v 1.3 1998/04/09 13:09:47 hannken Exp $ */
|
/* $NetBSD: wskbdvar.h,v 1.4 1998/06/11 22:15:15 drochner Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
|
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
|
||||||
|
@ -72,6 +72,8 @@ int wskbddevprint __P((void *, const char *));
|
||||||
* Callbacks from the keyboard driver to the wskbd interface driver.
|
* Callbacks from the keyboard driver to the wskbd interface driver.
|
||||||
*/
|
*/
|
||||||
void wskbd_input __P((struct device *kbddev, u_int type, int value));
|
void wskbd_input __P((struct device *kbddev, u_int type, int value));
|
||||||
|
/* for WSDISPLAY_COMPAT_RAWKBD */
|
||||||
|
void wskbd_rawinput __P((struct device *, char *, int));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Console interface.
|
* Console interface.
|
||||||
|
|
Loading…
Reference in New Issue