Hello,
this diff with current allows setting a useable kbd sf.apple and sg.apple (and the nodead variant) on a Macbook 1.1 (wscons)
(alternative was xorg.conf macbook79 with ch layout and fr variant,
 but without the beautiful spleen consolefont...)

Index: makemap.awk
===================================================================
RCS file: /home/cvs/src/sys/dev/usb/makemap.awk,v
retrieving revision 1.15
diff -u -p -r1.15 makemap.awk
--- makemap.awk 2 Nov 2020 19:45:18 -0000       1.15
+++ makemap.awk 4 Nov 2020 07:50:20 -0000
@@ -37,6 +37,7 @@ BEGIN {
        declk = 0
        haskeys = 0
        kbfr = 0
+       kbsg = 0
        nmaps = 0

        # PS/2 id -> UKBD conversion table, or "sanity lossage 101"
@@ -407,6 +408,38 @@ $1 == "#define" || $1 == "#undef" {
                        print "    KC(47),\tKS_masculine,\tKS_ordfeminine,"
                        print "    KC(50),\tKS_backslash,\tKS_bar,"
                        print "    KC(52),\tKS_dead_tilde,\tKS_dead_circumflex"
+               } else
+               if (mapname == "ukbd_keydesc_sg[]") {
+                       print $0
+                       print "\nstatic const keysym_t ukbd_keydesc_sg_apple[] = 
{"
+                       print "/*  pos      normal\t\tshifted\t\talt\t\tshift-alt 
*/"
+                       print "    KC(10),\tKS_g,\t\tKS_G,\t\tKS_at,"
+                       print "    KC(17),\tKS_n,\t\tKS_N,\t\tKS_dead_tilde,"
+                       print "    KC(30),\tKS_1,\t\tKS_plus,\tKS_plusminus,"
+                       print "    
KC(34),\tKS_5,\t\tKS_percent,\tKS_bracketleft,"
+                       print "    
KC(35),\tKS_6,\t\tKS_ampersand,\tKS_bracketright,"
+                       print "    
KC(36),\tKS_7,\t\tKS_slash,\tKS_bar,\t\tKS_backslash,"
+                       print "    
KC(37),\tKS_8,\t\tKS_parenleft,\tKS_braceleft,"
+                       print "    
KC(38),\tKS_9,\t\tKS_parenright,\tKS_braceright,"
+                       print "    KC(88),\tKS_Mode_switch,\tKS_Multi_key,"
+                       print "    KC(226),\tKS_Mode_switch,\tKS_Multi_key,"
+               } else
+               if (mapname == "ukbd_keydesc_sg_nodead[]") {
+                       print $0
+                       print "\nstatic const keysym_t 
ukbd_keydesc_sg_apple_nodead[] = {"
+                       print "/*  pos      normal\t\tshifted\t\talt\t\tshift-alt 
*/"
+                       print "    KC(17),\tKS_n,\t\tKS_N,\t\tKS_asciitilde,"
+                       print "    
KC(45),\tKS_apostrophe,\tKS_question,\tKS_acute,"
+                       print "    KC(46),\tKS_asciicircum,\tKS_grave,"
+                       print "    KC(48),\tKS_diaeresis,\tKS_exclam,"
+               } else
+               if (mapname == "ukbd_keydesc_sf[]") {
+                       print $0
+                       print "\nstatic const keysym_t ukbd_keydesc_sf_apple[] = 
{"
+                       print "/*  pos      normal\t\tshifted\t\talt\t\tshift-alt 
*/"
+                       print "    KC(47),\tKS_egrave,\tKS_udiaeresis,"
+                       print "    KC(51),\tKS_eacute,\tKS_odiaeresis,"
+                       print "    KC(52),\tKS_agrave,\tKS_adiaeresis,"
                }
        }
 }
@@ -425,6 +458,27 @@ $1 == "#define" || $1 == "#undef" {
 /KB_PT/ {
        print $0
        print "\tKBD_MAP(KB_PT | KB_APPLE,\tKB_PT,\tukbd_keydesc_pt_apple),"
+       next
+}
+/KB_SG/ {
+       print $0
+       kbsg++
+       if (kbsg == 1) {
+               print "\tKBD_MAP(KB_SG | 
KB_APPLE,\tKB_SG,\tukbd_keydesc_sg_apple),"
+       } else if (kbsg == 2) {
+               print "\tKBD_MAP(KB_SG | KB_APPLE | KB_NODEAD,\tKB_SG | 
KB_APPLE,"
+               print "\t\tukbd_keydesc_sg_apple_nodead),"
+       # Add first .apple variant for sf
+       } else if (kbsg == 3) {
+ print "\tKBD_MAP(KB_SF | KB_APPLE,\tKB_SG | KB_APPLE,\tukbd_keydesc_sf_apple),"
+       }
+       next
+}
+/KB_SF/ {
+       print $0
+       # Add second .apple variant for sf
+       print "\tKBD_MAP(KB_SF | KB_APPLE | KB_NODEAD,\tKB_SF | KB_APPLE,"
+       print "\t\tukbd_keydesc_sg_apple_nodead),"
        next
 }
 {
Index: ukbd.4
===================================================================
RCS file: /home/cvs/src/share/man/man4/ukbd.4,v
retrieving revision 1.22
diff -u -p -r1.22 ukbd.4
--- ukbd.4      11 May 2019 14:19:16 -0000      1.22
+++ ukbd.4      3 Nov 2020 19:36:27 -0000
@@ -171,10 +171,20 @@ Russian in
 .Pq sf
 Swiss French with
 .Dq dead accents .
+.It KB_SF | KB_APPLE
+.Pq sf.apple
+Swiss French with
+.Dq dead accents
+for MacBooks.
 .It KB_SG
 .Pq sg
 Swiss German with
 .Dq dead accents .
+.It KB_SG | KB_APPLE
+.Pq sg.apple
+Swiss German with
+.Dq dead accents
+for MacBooks.
 .It KB_SI
 .Pq si
 Slovenian.

Reply via email to