wskbd updates.

kbd.c: Now identifies itself as WSKBD_TYPE_AMIGA.
 wskbdmap_amiga.c: Updated de/dk/sv/no keymaps.
This commit is contained in:
jandberg 2002-01-13 22:47:43 +00:00
parent 5d3e829423
commit 75e5cd6d4f
2 changed files with 78 additions and 85 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: kbd.c,v 1.35 2001/02/02 21:52:11 is Exp $ */
/* $NetBSD: kbd.c,v 1.36 2002/01/13 22:47:43 jandberg Exp $ */
/*
* Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@ -70,6 +70,26 @@
* to wscons when initializing.
*/
/*
* Now with wscons this driver exhibits some weird behaviour.
* It may act both as a driver of its own and the md part of the
* wskbd driver. Therefore it can be accessed through /dev/kbd
* and /dev/wskbd0 both.
*
* The data from they keyboard may end up in at least four different
* places:
* - If this driver has been opened (/dev/kbd) and the
* direct mode (TIOCDIRECT) has been set, data goes to
* the process who opened the device. Data will transmit itself
* as described by the firm_event structure.
* - If wskbd support is compiled in and a wskbd driver has been
* attached then the data is sent to it. Wskbd in turn may
* - Send the data in the wscons_event form to a process that
* has opened /dev/wskbd0
* - Feed the data to a virtual terminal.
* - If an ite is present the data may be fed to it.
*/
#include "wskbd.h"
#if NWSKBD>0
@ -102,7 +122,7 @@ static struct wskbd_consops kbd_consops = {
};
/*
* Pointer to keymap. It is defined in wskbdmap_amiga.c.
* Pointer to keymaps. They are defined in wskbdmap_amiga.c.
*/
static struct wskbd_mapdata kbd_mapdata = {
amigakbd_keydesctab,
@ -768,12 +788,11 @@ kbd_ioctl(c, cmd, data, flag, p)
*(int*)data = 0;
return 0;
case WSKBDIO_GTYPE:
/* XXX well is it, dont think so */
*(u_int*)data = WSKBD_TYPE_PC_AT;
*(u_int*)data = WSKBD_TYPE_AMIGA;
return 0;
}
/* We are supposed to return -1 to wscons if we didnt understand */
/* We are supposed to return -1 to wscons if we didn't understand */
return (-1);
}

View File

@ -182,93 +182,86 @@ static const keysym_t amikbd_keydesc_de[] = {
KC(12), KS_dead_acute, KS_dead_grave,
KC(16), KS_q, KS_Q, KS_at,
KC(21), KS_z,
/*
KC(26), KS_udiaeresis,
KC(27), KS_plus, KS_asterisk, KS_dead_tilde,
KC(39), KS_odiaeresis,
KC(40), KS_adiaeresis,
KC(41), KS_dead_circumflex,KS_dead_abovering,
KC(41), KS_odiaeresis,
KC(42), KS_adiaeresis,
KC(13), KS_dead_circumflex,KS_dead_abovering,
KC(43), KS_numbersign, KS_apostrophe,
*/
KC(49), KS_y,
KC(55), KS_m, KS_M, KS_mu,
KC(56), KS_comma, KS_semicolon,
KC(57), KS_period, KS_colon,
KC(58), KS_minus, KS_underscore,
/*
KC(86), KS_less, KS_greater, KS_bar, KS_brokenbar,
KC(184), KS_Mode_switch, KS_Multi_key,
*/
KC(48), KS_less, KS_greater, KS_bar, KS_brokenbar,
KC(101), KS_Mode_switch, KS_Multi_key,
};
static const keysym_t pckbd_keydesc_de_nodead[] = {
static const keysym_t amikbd_keydesc_de_nodead[] = {
/* pos normal shifted altgr shift-altgr */
KC(13), KS_apostrophe, KS_grave,
KC(12), KS_apostrophe, KS_grave,
KC(27), KS_plus, KS_asterisk, KS_asciitilde,
KC(41), KS_asciicircum, KS_degree,
KC(0), KS_asciicircum, KS_degree,
};
static const keysym_t pckbd_keydesc_dk[] = {
static const keysym_t amikbd_keydesc_dk[] = {
/* pos normal shifted altgr shift-altgr */
KC(3), KS_2, KS_quotedbl, KS_at,
KC(4), KS_3, KS_numbersign, KS_sterling,
KC(5), KS_4, KS_currency, KS_dollar,
KC(7), KS_6, KS_ampersand,
KC(8), KS_7, KS_slash, KS_braceleft,
KC(9), KS_8, KS_parenleft, KS_bracketleft,
KC(10), KS_9, KS_parenright, KS_bracketright,
KC(11), KS_0, KS_equal, KS_braceright,
KC(12), KS_plus, KS_question,
KC(13), KS_dead_acute, KS_dead_grave, KS_bar,
KC(2), KS_2, KS_quotedbl, KS_at,
KC(3), KS_3, KS_numbersign, KS_sterling,
KC(4), KS_4, KS_currency, KS_dollar,
KC(6), KS_6, KS_ampersand,
KC(7), KS_7, KS_slash, KS_braceleft,
KC(8), KS_8, KS_parenleft, KS_bracketleft,
KC(9), KS_9, KS_parenright, KS_bracketright,
KC(10), KS_0, KS_equal, KS_braceright,
KC(11), KS_plus, KS_question,
KC(12), KS_dead_acute, KS_dead_grave, KS_bar,
KC(26), KS_aring,
KC(27), KS_dead_diaeresis, KS_dead_circumflex, KS_dead_tilde,
KC(39), KS_ae,
KC(40), KS_oslash,
KC(41), KS_onehalf, KS_paragraph,
KC(41), KS_ae,
KC(42), KS_oslash,
KC(43), KS_apostrophe, KS_asterisk,
KC(51), KS_comma, KS_semicolon,
KC(52), KS_period, KS_colon,
KC(53), KS_minus, KS_underscore,
KC(86), KS_less, KS_greater, KS_backslash,
KC(184), KS_Mode_switch, KS_Multi_key,
KC(56), KS_comma, KS_semicolon,
KC(57), KS_period, KS_colon,
KC(58), KS_minus, KS_underscore,
KC(48), KS_less, KS_greater, KS_backslash,
KC(101), KS_Mode_switch, KS_Multi_key,
};
static const keysym_t pckbd_keydesc_dk_nodead[] = {
static const keysym_t amikbd_keydesc_dk_nodead[] = {
/* pos normal shifted altgr shift-altgr */
KC(13), KS_apostrophe, KS_grave, KS_bar,
KC(12), KS_apostrophe, KS_grave, KS_bar,
KC(27), KS_diaeresis, KS_asciicircum, KS_asciitilde,
};
static const keysym_t pckbd_keydesc_sv[] = {
static const keysym_t amikbd_keydesc_sv[] = {
/* pos normal shifted altgr shift-altgr */
KC(12), KS_plus, KS_question, KS_backslash,
KC(11), KS_plus, KS_question, KS_backslash,
KC(27), KS_dead_diaeresis, KS_dead_circumflex, KS_dead_tilde,
KC(39), KS_odiaeresis,
KC(40), KS_adiaeresis,
KC(41), KS_paragraph, KS_onehalf,
KC(86), KS_less, KS_greater, KS_bar,
KC(184), KS_Mode_switch, KS_Multi_key,
KC(41), KS_odiaeresis,
KC(42), KS_adiaeresis,
KC(48), KS_less, KS_greater, KS_bar,
KC(101), KS_Mode_switch, KS_Multi_key,
};
static const keysym_t pckbd_keydesc_sv_nodead[] = {
static const keysym_t amikbd_keydesc_sv_nodead[] = {
/* pos normal shifted altgr shift-altgr */
KC(13), KS_apostrophe, KS_grave, KS_bar,
KC(12), KS_apostrophe, KS_grave, KS_bar,
KC(27), KS_diaeresis, KS_asciicircum, KS_asciitilde,
};
static const keysym_t pckbd_keydesc_no[] = {
static const keysym_t amikbd_keydesc_no[] = {
/* pos normal shifted altgr shift-altgr */
KC(13), KS_backslash, KS_dead_grave, KS_dead_acute,
KC(12), KS_backslash, KS_dead_grave, KS_dead_acute,
KC(27), KS_dead_diaeresis, KS_dead_circumflex, KS_dead_tilde,
KC(39), KS_oslash,
KC(40), KS_ae,
KC(41), KS_bar, KS_paragraph,
KC(86), KS_less, KS_greater,
KC(41), KS_oslash,
KC(42), KS_ae,
KC(48), KS_less, KS_greater,
};
static const keysym_t pckbd_keydesc_no_nodead[] = {
static const keysym_t amikbd_keydesc_no_nodead[] = {
/* pos normal shifted altgr shift-altgr */
KC(13), KS_backslash, KS_grave, KS_acute,
KC(12), KS_backslash, KS_grave, KS_acute,
KC(27), KS_diaeresis, KS_asciicircum, KS_asciitilde,
};
@ -481,49 +474,30 @@ static const keysym_t pckbd_keydesc_swapctrlcaps[] = {
KC(58), KS_Cmd1, KS_Control_L,
};
static const keysym_t pckbd_keydesc_iopener[] = {
/* pos command normal shifted */
KC(59), KS_Cmd_Debugger, KS_Escape,
KC(60), KS_Cmd_Screen0, KS_f1,
KC(61), KS_Cmd_Screen1, KS_f2,
KC(62), KS_Cmd_Screen2, KS_f3,
KC(63), KS_Cmd_Screen3, KS_f4,
KC(64), KS_Cmd_Screen4, KS_f5,
KC(65), KS_Cmd_Screen5, KS_f6,
KC(66), KS_Cmd_Screen6, KS_f7,
KC(67), KS_Cmd_Screen7, KS_f8,
KC(68), KS_Cmd_Screen8, KS_f9,
KC(87), KS_Cmd_Screen9, KS_f10,
KC(88), KS_f11,
};
#define KBD_MAP(name, base, map) \
{ name, base, sizeof(map)/sizeof(keysym_t), map }
const struct wscons_keydesc amigakbd_keydesctab[] = {
KBD_MAP(KB_US, 0, amikbd_keydesc_us),
KBD_MAP(KB_DE, KB_US, amikbd_keydesc_de),
/* KBD_MAP(KB_DE | KB_NODEAD, KB_DE, pckbd_keydesc_de_nodead),
KBD_MAP(KB_FR, KB_US, pckbd_keydesc_fr),
KBD_MAP(KB_DK, KB_US, pckbd_keydesc_dk),
KBD_MAP(KB_DK | KB_NODEAD, KB_DK, pckbd_keydesc_dk_nodead),
KBD_MAP(KB_IT, KB_US, pckbd_keydesc_it),
KBD_MAP(KB_DE | KB_NODEAD, KB_DE, amikbd_keydesc_de_nodead),
/* KBD_MAP(KB_FR, KB_US, pckbd_keydesc_fr),*/
KBD_MAP(KB_DK, KB_US, amikbd_keydesc_dk),
KBD_MAP(KB_DK | KB_NODEAD, KB_DK, amikbd_keydesc_dk_nodead),
/* KBD_MAP(KB_IT, KB_US, pckbd_keydesc_it),
KBD_MAP(KB_UK, KB_US, pckbd_keydesc_uk),
KBD_MAP(KB_JP, KB_US, pckbd_keydesc_jp),
KBD_MAP(KB_SV, KB_DK, pckbd_keydesc_sv),
KBD_MAP(KB_SV | KB_NODEAD, KB_SV, pckbd_keydesc_sv_nodead),
KBD_MAP(KB_NO, KB_DK, pckbd_keydesc_no),
KBD_MAP(KB_NO | KB_NODEAD, KB_NO, pckbd_keydesc_no_nodead),
KBD_MAP(KB_US | KB_DECLK, KB_US, pckbd_keydesc_us_declk),
KBD_MAP(KB_JP, KB_US, pckbd_keydesc_jp),*/
KBD_MAP(KB_SV, KB_DK, amikbd_keydesc_sv),
KBD_MAP(KB_SV | KB_NODEAD, KB_SV, amikbd_keydesc_sv_nodead),
KBD_MAP(KB_NO, KB_DK, amikbd_keydesc_no),
KBD_MAP(KB_NO | KB_NODEAD, KB_NO, amikbd_keydesc_no_nodead),
/* KBD_MAP(KB_US | KB_DECLK, KB_US, pckbd_keydesc_us_declk),
KBD_MAP(KB_US | KB_DVORAK, KB_US, pckbd_keydesc_us_dvorak),
KBD_MAP(KB_US | KB_SWAPCTRLCAPS, KB_US, pckbd_keydesc_swapctrlcaps),
KBD_MAP(KB_US | KB_IOPENER, KB_US, pckbd_keydesc_iopener),
KBD_MAP(KB_JP | KB_SWAPCTRLCAPS, KB_JP, pckbd_keydesc_swapctrlcaps),
KBD_MAP(KB_FR | KB_SWAPCTRLCAPS, KB_FR, pckbd_keydesc_swapctrlcaps),
KBD_MAP(KB_US | KB_DVORAK | KB_SWAPCTRLCAPS, KB_US | KB_DVORAK,
pckbd_keydesc_swapctrlcaps),
KBD_MAP(KB_US | KB_IOPENER | KB_SWAPCTRLCAPS, KB_US | KB_IOPENER,
pckbd_keydesc_swapctrlcaps),
KBD_MAP(KB_ES , KB_US, pckbd_keydesc_es),
*/
{0, 0, 0, 0}