> Am 23.11.2022 um 11:43 schrieb Vlad Meșco <vlad.me...@gmail.com>:
> 
> On Wed, Nov 23, 2022 at 06:57:17AM +0000, Jason McIntyre wrote:
>> On Wed, Nov 23, 2022 at 12:21:26AM +0100, Mike Fischer wrote:
>>> Hi!
>>> 
>>> I???m trying to use a German Apple Mac keyboard with OpenBSD 7.2 and I???d 
>>> like to match the mapping to that of macOS.
>>> 
>>> `wsconsctl keyboard.encoding=de` helps, but several mappings are 
>>> different/missing. For example the pipe character | should be alt-7 but 
>>> isn???t. Mostly the alt-combinations are missing or wrong.
>>> 
>>> So I thought I could use keyboard.map settings to correct this. But I 
>>> can???t find any documentation of the format ??? very unusual for OpenBSD.
>>> 
>>> Did I miss something?
>>> 
>>> Can someone point me to the documentation please?
>>> 
>>> Thanks!
>>> 
>>> Mike
>>> 
>> 
>> hi.
>> 
>> maybe you are looking for wsksymdef.h:
>> 
>>    WSCONSCTL(8)       System Manager's Manual         WSCONSCTL(8)
>> 
>>      ...
>> 
>>       Modify the current keyboard encoding so that, when the Caps
>>       Lock key is pressed, the same encoding sequence as Left
>>       Control is sent.  For a full list of keysyms, and keycodes,
>>       refer to the /usr/include/dev/wscons/wsksymdef.h file.
>> 
>>             # wsconsctl keyboard.map+="keysym Caps_Lock =
>>             Control_L"
>> 
>> jmc
>> 
> 
> Hey,
> 
> If it helps, here's my wsconsctl.conf to add some Romanian keyboard
> bindings in the console for keys which are behind AltGr. Note, I've
> intentionally made some Romanian specific unicode characters output
> a literal `?' since they're not very usable in wscons.
> 
> You can either use symbolic names (from wsksymdef.h) or use stuff like
> `unknown_51355' to give it a U+code point in decimal form. For German,
> you probably have everything you need in wsksymdef.h. Note, the format
> is also very similar to xkb; originally I thought they were the same
> (they aren't 100% the same).
> 
> 
>    keyboard.encoding=us
>    keyboard.map+="keysym Caps_Lock = Control_L"
>    mouse.tp.tapping=3
>    mouse.reverse_scrolling=1
>    keyboard.map+="keysym Caps_Lock = Control_L“

Duplicate?

>    keyboard.map+="keycode 184 = Cmd2 Mode_switch Multi_key“

I don’t think I understand what this actually does?

First of all none of my ‚keyboard.map's have a keycode 184. I tried 
keyboard.encoding=us, keyboard.encoding=de, keyboard.encoding=fr, 
keyboard.encoding=fr.apple.

Second, if the columns normally represent levels (or layers), how does that 
work here? Plain 184 is Cmd2; 184 + some modifier is Mode_switch; and 184 + 
some other modifier is Multi_key (whatever that is supposed to mean)?


>    # use ? for unicode that causes mojibake
>    keyboard.map+="keycode 26 = question question bracketleft braceleft"
>    keyboard.map+="keycode 27 = question question bracketright braceright"
>    keyboard.map+="keycode 39 = question question semicolon colon"
>    keyboard.map+="keycode 40 = question question apostrophe quotedbl"
>    keyboard.map+="keycode 41 = question question grave asciitilde" # 3byte 
> UTF-8, don't bother
>    keyboard.map+="keycode 43 = question question backslash bar"
>    keyboard.map+="keycode 51 = comma semicolon less question"
>    keyboard.map+="keycode 52 = period colon greater question"
> 
> A more proper example for e.g. keycode 26:
> 
>    keyboard.map+="keycode 26 = abreve Abreve bracketleft braceleft"
> 
> Or for keys that don't have a symbolic name:
> 
>    keyboard.map+="keycode 43 = unknown_50082 unknown_50050 backslash bar"
> 
> I started from US which is 90% there, and the first thing is to add
> right Alt as `Mode_switch', otherwise it's just (left) Alt (which I
> think just sets the MSB, IDK; you want AltGr/Mode_switch if you want to
> map specific characters).
> 
> Which keycode is what? I don't know. I dumped the hu layout as a
> reference with `doas wsconsctl keyboard.map > hu.map' and looked at what
> was done for that crazy layout, and started from there.
> 
> Cheers,
> Vlad

Thanks, that helps somewhat. It still is strange to have to resort to 
experiments to figure things out instead of having them documented on OpenBSD.

By xkb do you mean xkeyboard-config(7)? I have looked at the man page but I 
honestly can’t see much similarity to the keyboard.map syntax. I also looked at 
setxkbmap(1) and xkbcomp(1) but they where no help either. I don’t normally use 
X for anything so I am not very familiar with all of the associated settings.

https://www.x.org/wiki/XKB/ did seem to explain some relevant concepts though. 
For example the concept of levels which probably translates to the columns used 
in the keycode statements? But where are the definitions of which modifier (or 
combination thereof) selects which column?


I gather the built-in maps for e.g. us, de, fr.apple, etc. are actually 
compiled into some code, not config files somwhere on disk?


Thanks!
Mike

Reply via email to