Skip to content

Commit

Permalink
Fix double quote cannot be typed from Mac keylayout file
Browse files Browse the repository at this point in the history
  • Loading branch information
narze authored Sep 12, 2021
1 parent 873f2d6 commit 35e3dc7
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 14 deletions.
8 changes: 8 additions & 0 deletions generateKeylayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,14 @@ export async function generateKeylayout(
overrideKey = escape("&")
}

if (overrideKey == "'") {
overrideKey = escape("'")
}

if (overrideKey == "\"") {
overrideKey = escape(""")
}

if (overrideKey == ">") {
overrideKey = ">"
} else if (overrideKey == "<") {
Expand Down
10 changes: 5 additions & 5 deletions output/Manoonchai-ColemakDH-Mod.keylayout
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
<key code="36" output="&#x000D;"/>
<key code="37" output=""/>
<key code="38" output=""/>
<key code="39" output="&quot;"/>
<key code="39" output="&#x0022;"/>
<key code="40" output=""/>
<key code="41" output=""/>
<key code="42" output=""/>
Expand Down Expand Up @@ -283,7 +283,7 @@
<key code="36" output="&#x000D;"/>
<key code="37" output="i"/>
<key code="38" output="n"/>
<key code="39" output="'"/>
<key code="39" output="&#x0027;"/>
<key code="40" output="e"/>
<key code="41" output="o"/>
<key code="42" output="\"/>
Expand Down Expand Up @@ -392,7 +392,7 @@
<key code="36" output="&#x000D;"/>
<key code="37" output="i"/>
<key code="38" output=""/>
<key code="39" output="'"/>
<key code="39" output="&#x0027;"/>
<key code="40" output=""/>
<key code="41" output="o"/>
<key code="42" output="\"/>
Expand Down Expand Up @@ -501,7 +501,7 @@
<key code="36" output="&#x000D;"/>
<key code="37" output="i"/>
<key code="38" output="n"/>
<key code="39" output="'"/>
<key code="39" output="&#x0027;"/>
<key code="40" output="e"/>
<key code="41" output="o"/>
<key code="42" output="\"/>
Expand Down Expand Up @@ -610,7 +610,7 @@
<key code="36" output="&#x000D;"/>
<key code="37" output=""/>
<key code="38" output=""/>
<key code="39" output="&quot;"/>
<key code="39" output="&#x0022;"/>
<key code="40" output=""/>
<key code="41" output=""/>
<key code="42" output="|"/>
Expand Down
58 changes: 58 additions & 0 deletions output/Manoonchai-ColemakDH-Mod_xkb
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
partial alphanumeric_keys
xkb_symbols "Mnc-DH" {

// COPYRIGHT "MIT"

name[Group1]= "Manoonchai v1.0";


key <AE10> { [ 0x1000030, 0x1000029, 0x1000030, 0x1000e50 0x1000030 voidsymbol ] };
key <AE01> { [ 0x1000031, 0x1000021, 0x1000031, 0x1000e51 0x1000031 voidsymbol ] };
key <AE02> { [ 0x1000032, 0x1000040, 0x1000032, 0x1000e52 0x1000032 voidsymbol ] };
key <AE03> { [ 0x1000033, 0x1000023, 0x1000033, 0x1000e53 0x1000033 voidsymbol ] };
key <AE04> { [ 0x1000034, 0x1000024, 0x1000034, 0x1000e54 0x1000034 voidsymbol ] };
key <AE05> { [ 0x1000035, 0x1000025, 0x1000035, 0x1000e55 0x1000035 voidsymbol ] };
key <AE06> { [ 0x1000036, 0x100005e, 0x1000036, 0x1000e56 0x1000036 voidsymbol ] };
key <AE07> { [ 0x1000037, 0x1000026, 0x1000037, 0x1000e57 0x1000037 voidsymbol ] };
key <AE08> { [ 0x1000038, 0x100002a, 0x1000038, 0x1000e58 0x1000038 voidsymbol ] };
key <AE09> { [ 0x1000039, 0x1000028, 0x1000039, 0x1000e59 0x1000039 voidsymbol ] };
key <AE11> { [ 0x100002d, 0x100005f, 0x100002d, 0x100002d 0x100002d voidsymbol ] };
key <AE12> { [ 0x100003d, 0x100002b, 0x100003d, 0x100003d 0x100003d voidsymbol ] };
key <TLDE> { [ 0x1000060, 0x100007e, 0x1000060, 0x1000060 0x1000060 voidsymbol ] };
key <AD01> { [ 0x1000e43, 0x1000e12, 0x1000071, 0x1000071 0x1000071 voidsymbol ] };
key <AD02> { [ 0x1000e15, 0x1000e0f, 0x1000077, 0x1000077 0x1000077 voidsymbol ] };
key <AD03> { [ 0x1000e2b, 0x1000e0b, 0x1000066, 0x1000066 0x1000066 voidsymbol ] };
key <AD04> { [ 0x1000e25, 0x1000e0d, 0x1000070, 0x1000070 0x1000070 voidsymbol ] };
key <AD05> { [ 0x1000e2a, 0x1000e1f, 0x1000062, 0x1000062 0x1000062 voidsymbol ] };
key <AD06> { [ 0x1000e1b, 0x1000e09, 0x100006a, 0x100006a 0x100006a voidsymbol ] };
key <AD07> { [ 0x1000e31, 0x1000e36, 0x100006c, 0x1000e3a 0x100006c voidsymbol ] };
key <AD08> { [ 0x1000e01, 0x1000e18, 0x1000075, 0x1000075 0x1000075 voidsymbol ] };
key <AD09> { [ 0x1000e34, 0x1000e10, 0x1000079, 0x1000079 0x1000079 voidsymbol ] };
key <AD10> { [ 0x1000e1a, 0x1000e0e, 0x100003b, 0x100003b 0x100003b 0x100003a ] };
key <AD11> { [ 0x1000e47, 0x1000e06, 0x100005b, 0x100005b 0x100005b 0x100007b ] };
key <AD12> { [ 0x1000e2c, 0x1000e11, 0x100005d, 0x100005d 0x100005d 0x100007d ] };
key <AC01> { [ 0x1000e07, 0x1000e29, 0x1000061, 0x10025cc 0x1000061 voidsymbol ] };
key <AC02> { [ 0x1000e40, 0x1000e16, 0x1000072, 0x1000e4f 0x1000072 voidsymbol ] };
key <AC03> { [ 0x1000e23, 0x1000e41, 0x1000073, 0x1000e5b 0x1000073 voidsymbol ] };
key <AC04> { [ 0x1000e19, 0x1000e0a, 0x1000074, 0x1000e3f 0x1000074 voidsymbol ] };
key <AC05> { [ 0x1000e21, 0x1000e1e, 0x1000067, 0x1000067 0x1000067 voidsymbol ] };
key <AC06> { [ 0x1000e2d, 0x1000e1c, 0x100006d, 0x1000e4d 0x100006d voidsymbol ] };
key <AC07> { [ 0x1000e32, 0x1000e33, 0x100006e, 0x1000e45 0x100006e voidsymbol ] };
key <AC08> { [ 0x1000e48, 0x1000e02, 0x1000065, 0x1000e03 0x1000065 voidsymbol ] };
key <AC09> { [ 0x1000e49, 0x1000e42, 0x1000069, 0x1000069 0x1000069 voidsymbol ] };
key <AC10> { [ 0x1000e27, 0x1000e20, 0x100006f, 0x100006f 0x100006f voidsymbol ] };
key <AC11> { [ 0x1000e37, 0x1000022, 0x1000027, 0x1000027 0x1000027 0x1000022 ] };
key <BKSL> { [ 0x1000e2f, 0x1000e0c, 0x100005c, 0x100005c 0x100005c 0x100007c ] };
key <AB01> { [ 0x1000e38, 0x1000e24, 0x100007a, 0x1000e26 0x100007a voidsymbol ] };
key <AB02> { [ 0x1000e44, 0x1000e1d, 0x1000078, 0x1000078 0x1000078 voidsymbol ] };
key <AB03> { [ 0x1000e17, 0x1000e46, 0x1000063, 0x1000e5a 0x1000063 voidsymbol ] };
key <AB04> { [ 0x1000e22, 0x1000e13, 0x1000076, 0x1000076 0x1000076 voidsymbol ] };
key <AB05> { [ 0x1000e08, 0x1000e4a, 0x1000064, 0x1000064 0x1000064 voidsymbol ] };
key <AB06> { [ 0x1000e04, 0x1000e4b, 0x100006b, 0x1000e05 0x100006b voidsymbol ] };
key <AB07> { [ 0x1000e35, 0x1000e4c, 0x1000068, 0x1000e4e 0x1000068 voidsymbol ] };
key <AB08> { [ 0x1000e14, 0x1000e28, 0x100002c, 0x100002c 0x100002c 0x100003c ] };
key <AB09> { [ 0x1000e30, 0x1000e2e, 0x100002e, 0x100002e 0x100002e 0x100003e ] };
key <AB10> { [ 0x1000e39, 0x100003f, 0x100002f, 0x100002f 0x100002f 0x100003f ] };

include "level3(ralt_switch)"
};
10 changes: 5 additions & 5 deletions output/Manoonchai-WittNV.keylayout
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
<key code="36" output="&#x000D;"/>
<key code="37" output=""/>
<key code="38" output=""/>
<key code="39" output="&quot;"/>
<key code="39" output="&#x0022;"/>
<key code="40" output=""/>
<key code="41" output=""/>
<key code="42" output=""/>
Expand Down Expand Up @@ -283,7 +283,7 @@
<key code="36" output="&#x000D;"/>
<key code="37" output="i"/>
<key code="38" output="n"/>
<key code="39" output="'"/>
<key code="39" output="&#x0027;"/>
<key code="40" output="e"/>
<key code="41" output="o"/>
<key code="42" output="\"/>
Expand Down Expand Up @@ -392,7 +392,7 @@
<key code="36" output="&#x000D;"/>
<key code="37" output="i"/>
<key code="38" output=""/>
<key code="39" output="'"/>
<key code="39" output="&#x0027;"/>
<key code="40" output=""/>
<key code="41" output="o"/>
<key code="42" output="\"/>
Expand Down Expand Up @@ -501,7 +501,7 @@
<key code="36" output="&#x000D;"/>
<key code="37" output="i"/>
<key code="38" output="n"/>
<key code="39" output="'"/>
<key code="39" output="&#x0027;"/>
<key code="40" output="e"/>
<key code="41" output="o"/>
<key code="42" output="\"/>
Expand Down Expand Up @@ -610,7 +610,7 @@
<key code="36" output="&#x000D;"/>
<key code="37" output=""/>
<key code="38" output=""/>
<key code="39" output="&quot;"/>
<key code="39" output="&#x0022;"/>
<key code="40" output=""/>
<key code="41" output=""/>
<key code="42" output="|"/>
Expand Down
6 changes: 3 additions & 3 deletions output/Manoonchai.keylayout
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
<key code="36" output="&#x000D;"/>
<key code="37" output=""/>
<key code="38" output=""/>
<key code="39" output="&quot;"/>
<key code="39" output="&#x0022;"/>
<key code="40" output=""/>
<key code="41" output=""/>
<key code="42" output=""/>
Expand Down Expand Up @@ -277,7 +277,7 @@
<key code="36" output="&#x000D;"/>
<key code="37" output=""/>
<key code="38" output=""/>
<key code="39" output="'"/>
<key code="39" output="&#x0027;"/>
<key code="40" output=""/>
<key code="41" output=";"/>
<key code="42" output="\"/>
Expand Down Expand Up @@ -386,7 +386,7 @@
<key code="36" output="&#x000D;"/>
<key code="37" output=""/>
<key code="38" output=""/>
<key code="39" output="&quot;"/>
<key code="39" output="&#x0022;"/>
<key code="40" output=""/>
<key code="41" output=":"/>
<key code="42" output="|"/>
Expand Down
2 changes: 1 addition & 1 deletion test/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ describe("generateLayout", () => {
{ code: "36", output: escape("&#x000D;") },
{ code: "37", output: "โ" },
{ code: "38", output: "ำ" },
{ code: "39", output: '"' },
{ code: "39", output: escape("&#x0022;") },
{ code: "40", output: "ข" },
{ code: "41", output: "ภ" },
{ code: "42", output: "ฌ" },
Expand Down

0 comments on commit 35e3dc7

Please sign in to comment.