NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Setting wscons encoding on sparc



Den Mon, 26 Oct 2026 11:55:15 +0000 (UTC)
skrev RVP <rvp%SDF.ORG@localhost>:

> On Mon, 26 Oct 2026, Eivind Nicolay Evensen wrote:
> 
> > # wsconsctl -a
> > type=sun
> > [...]
> >  
> 
> Doesn't look like there's a KB_NO keymap for Sun keyboards:
> 
> https://github.com/NetBSD/src/blob/trunk/sys/dev/sun/wskbdmap_sun.c#L334

Thanks for the hint for where to start looking. I've had a first look and
a first go at this, with somewhat limited success.

My thought was to copy the swedish layout I found there. After all,
Norwegian, Swedish and Danish keyboards are alike enough that to
increase profits at the buyer's loss, many keyboards now come with
three letters on each key for each of ÆØÅ (the Norwegian keys), avoiding
keycaps for each country.

I noticed by the way, that even before messing with this, when setting
the Swedish layout, I saw this:

# wsconsctl -w encoding=sv
encoding -> fi

Which doesn't seem quite right.

Anyway, with the diff appended below, I can set "Norwegian" encoding:

nbsparc2# wsconsctl -w encoding=no
encoding -> no

However, there are keys missing. Right of P and right of L the keys
doesn't respond. The \ (to the left of backspace) also isn't responding.
I do know that qemu is able to send something here, since it works booting
sunos 4.1 in qemu.

Lacking real hardware, to get things right, I'm not certain what can
come of this.

-- 
Eivind Nicolay Evensen



Index: sys/dev/sun/wskbdmap_sun.c
===================================================================
RCS file: /cvsroot/src/sys/dev/sun/wskbdmap_sun.c,v
retrieving revision 1.17
diff -u -u -p -r1.17 wskbdmap_sun.c
--- sys/dev/sun/wskbdmap_sun.c	14 Jan 2010 02:18:59 -0000	1.17
+++ sys/dev/sun/wskbdmap_sun.c	26 Oct 2026 14:56:33 -0000
@@ -208,6 +208,34 @@ const keysym_t wssun_keydesctab_sv_nodea
     KC(0x41),		KS_diaeresis,	KS_asciicircum,	KS_asciitilde,
 };
 
+const keysym_t wssun_keydesctab_no[] = {
+    KC(0x0d),		KS_Multi_key,
+    KC(0x0f),		KS_asciitilde,	KS_asciicircum,
+    KC(0x1f),		KS_2,		KS_quotedbl,	KS_at,
+    KC(0x20),		KS_3,		KS_numbersign,	KS_sterling,
+    KC(0x21),		KS_4,		KS_currency,	KS_dollar,
+    KC(0x23),		KS_6,		KS_ampersand,
+    KC(0x24),		KS_7,		KS_slash,	KS_braceleft,
+    KC(0x25),		KS_8,		KS_parenleft,	KS_bracketleft,
+    KC(0x26),		KS_9,		KS_parenright,	KS_bracketright,
+    KC(0x27),		KS_0,		KS_equal,	KS_braceright,
+    KC(0x28),		KS_plus,	KS_question,	KS_backslash,
+    KC(0x29),		KS_dead_acute,	KS_dead_grave,
+    KC(0x2a),		KS_apostrophe,	KS_asterisk,	KS_grave,
+    KC(0x40),		KS_aring,
+    KC(0x41),		KS_dead_diaeresis,KS_dead_circumflex,KS_dead_tilde,
+    KC(0x43),		KS_Mode_switch,
+    KC(0x4c),		KS_Caps_Lock,
+    KC(0x56),		KS_odiaeresis,
+    KC(0x57),		KS_adiaeresis,
+    KC(0x58),		KS_paragraph,	KS_onehalf,
+    KC(0x6b),		KS_comma,	KS_semicolon,
+    KC(0x6c),		KS_period,	KS_colon,
+    KC(0x6d),		KS_minus,	KS_underscore,
+    KC(0x77),		KS_Control_L,
+    KC(0x7c),		KS_less,	KS_greater,	KS_bar,
+};
+
 const keysym_t wssun_keydesctab_de[] = {
     KC(0x0d),		KS_Mode_switch,	/* Alt Graph (Alt R code) */
     KC(0x1f),		KS_2,		KS_quotedbl,	KS_twosuperior,
@@ -335,6 +363,7 @@ const struct wscons_keydesc wssun_keydes
 	KBD_MAP(KB_US,			0,	wssun_keydesctab_us),
 	KBD_MAP(KB_SV,			KB_US,	wssun_keydesctab_sv),
 	KBD_MAP(KB_SV | KB_NODEAD,	KB_SV,	wssun_keydesctab_sv_nodead),
+	KBD_MAP(KB_NO,			KB_US,	wssun_keydesctab_no),
 	KBD_MAP(KB_DE,			KB_US,	wssun_keydesctab_de),
 	KBD_MAP(KB_DE | KB_NODEAD,	KB_DE,	wssun_keydesctab_de_nodead),
 	KBD_MAP(KB_UK,			KB_US,	wssun_keydesctab_uk),


Home | Main Index | Thread Index | Old Index