Doing it via wscons(4) requires recompiling the kernel I think. Have a look at wskbd(4) and https://cvsweb.openbsd.org/src/sys/dev/pckbc/
OpenBSD
General OpenBSD community!
I eventually managed to do it with /etc/wsconsctl.conf
. You can load a base layout ("fr" in my case), and remap keys as you want using their symbols. Here is an exerpt from what I've done:
keyboard.encoding=fr
keyboard.map+="keycode 1 = at numbersign dead_breve dead_invertedbreve"
keyboard.map+="keycode 2 = agrave 1 section Agrave"
keyboard.map+="keycode 3 = eacute 2 dead_acute Eacute"
keyboard.map+="keycode 4 = egrave 3 dead_grave Egrave"
[…]
The hardest part is to figure which keycode correspond to which key on the keyboard, but it's not too hard if you dump the base layout with wsconsctl keyboard.map
before-hand.
Nice - thanks for sharing
depending on what sort of keyboard you have, you could do it in the keyboard's firmware:
I already use QMK and even have a base layer to emulate this keymap indeed :) But I feel like I should be able to do it "correctly" on openbsd.
The machine in question is a notebook so I'd like to be able to use this layout on the integrated keyboard.
I have not done it and rely on setxkbmap since I mainly use X whenever I can. However according to the openbsd mailing list^1^ you should create /etc/wsconsctl.conf
(see wsconsctl.conf(5)) and fill it with the correct values.
I'll try that, thanks !