After switching to the us layout with
wsconsctl -w encoding=us I was looking for a way to modify the keymap to my liking.
wsconsctl -w map+="keycode 1 = Cmd_Debugger Caps_Lock" wsconsctl -w map+="keycode 58 = Escape"
to swap caps lock and escape keys (I'm a Vim user, so this kind of swap makes sense).
wsconsctl map set
keycode 184 = Mode_switch Multi_key, which as far as I understand, is the function you get with AltGr on a German keyboard, for instance.
I tried setting keycode 184 to
Mode_switch (it's normally set to
Alt_R, which does nothing for me), but I do't exactly get the functionality of AltGr it seems.
Since NetBSD doesn't seem to come with a US AltGr-Intl variant, I though of defining at least some of the keys I need (which are German umlauts, for instance) myself, and "backport" the AltGr-Intl variant that way.
So the first thing I tried was
wsconsctl -w map+="keycode 16 = q Q adiaeresis Adiaeresis"
When I do that, I get weird error codes on the console, when typing AltGr + q:
<00ef> looks like a utf-8 code or something similar to me. Anyway it's not producing an 'ä', as I'd expect.
Also, when checking what's in the keymap now, after having it changed, this is what happens:
# wsconsctl map | grep -i "code 16" keycode 16 = q Q adiaeresis gr_D
gr_D"? Where did that come from? For some reason
wsconsctl seems to dislike
Adiaeresis even though it's in
/usr/include/dev/wscons/wsksymdef.h line 192:
#define KS_Adiaeresis 0xc4
I noticed that it doesn't happen with every character.
I tried mapping
wsconsctl -w map+="keycode 16 = q Q at at" and that works fine. After that, I can type a '@', by hitting AltGr + q.
Also, When I'm at the login prompt, I can type special characters by holding down AltGr, entering
äåéóöëíúáßðfø¶œï as a user name is no problem, but once I log in, it seems to load the us encoding, and I just have a plain US layout from then on.
Basically, the idea is to be able to enter special (latin) characters by holding down AltGr, or right Alt.
The OS is NetBSD 7.0/amd64 running in a VM on an amd64 host (Linux).