Le 24 novembre 2022 04:12:43 GMT+02:00, Mike Fischer <fischer+o...@lavielle.com> a écrit : > >> 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:
>> >> >> 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? ...probably. > >> keyboard.map+="keycode 184 = Cmd2 Mode_switch Multi_key“ > >I don’t think I understand what this actually does? > In my case, maps right alt to AltGr. I don't remember exactly how it works, but I think CmdN tells the driver it's a modifier and the next N tokens tell it what. >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. > I don't know, there might be differences between PC, USB and Apple. I mentioned HU earlier because that definitely has altgr defined. >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? > It's usually the same 4, plain, shift, altgr, altgr+shift. The source for pckbc calls them such. https://cvsweb.openbsd.org/src/sys/dev/pckbc/wskbdmap_mfii.c?rev=1.47&content-type=text/x-cvsweb-markup > >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? Yes, part of pckbc, usb keyboard (derived from the PC one) and Apple ADB. See usr/src/sys/dev/pckbc/wskbdmap_mfii, dev/usb/uwskbmap, dev/adb. Technically you can fully define them with wsconsctl by stating out each keycode (I think this is called custom or user). > > >Thanks! >Mike