diff --git a/generateKeylayout.ts b/generateKeylayout.ts index 4b760e4..222fd63 100644 --- a/generateKeylayout.ts +++ b/generateKeylayout.ts @@ -32,6 +32,10 @@ export async function generateKeylayout( layerName: "AltGr", layerValue: "anyOption anyShift? anyControl? command?", }, + { + layerName: "ShiftAltGr", + layerValue: "anyOption anyShift anyControl? command?", + }, { layerName: "Control", layerValue: "anyControl anyShift? anyOption? command?", @@ -253,6 +257,12 @@ export async function generateKeylayout( overrideKey = escape("&") } + if (overrideKey == ">") { + overrideKey = ">" + } else if (overrideKey == "<") { + overrideKey = "<" + } + if (unicode) { overrideKey = encodeURIComponent(output) } diff --git a/generateKlc.ts b/generateKlc.ts index ecdb9e3..688d777 100644 --- a/generateKlc.ts +++ b/generateKlc.ts @@ -38,6 +38,7 @@ export async function generateKlc( // From macOS config Command: 4, // Layer number 4 is not supported in KLC AltGr: 6, + ShiftAltGr: 7, Option: 7, Control: 2, } diff --git a/input/Manoonchai.json b/input/Manoonchai.json index 336a9e6..584be25 100644 --- a/input/Manoonchai.json +++ b/input/Manoonchai.json @@ -2,7 +2,7 @@ "name": "Manoonchai", "version": "1.0", "language": "Thai", - "layers": ["Base", "Shift", "AltGr"], + "layers": ["Base", "Shift", "AltGr", "ShiftAltGr"], "license": "MIT", "os": { "windows": { @@ -12,52 +12,52 @@ } }, "keys": { - "`": ["`", "~", "`"], - "1": ["1", "!", "๑"], - "2": ["2", "@", "๒"], - "3": ["3", "#", "๓"], - "4": ["4", "$", "๔"], - "5": ["5", "%", "๕"], - "6": ["6", "^", "๖"], - "7": ["7", "&", "๗"], - "8": ["8", "*", "๘"], - "9": ["9", "(", "๙"], - "0": ["0", ")", "๐"], - "-": ["-", "_", "-"], - "=": ["=", "+", "="], - "q": ["ใ", "ฒ", ""], - "w": ["ต", "ฏ", ""], - "e": ["ห", "ซ", ""], - "r": ["ล", "ญ", ""], - "t": ["ส", "ฟ", ""], - "y": ["ป", "ฉ", ""], - "u": ["ั", "ึ", "ฺ"], - "i": ["ก", "ธ", ""], - "o": ["ิ", "ฐ", ""], - "p": ["บ", "ฎ", ""], - "[": ["็", "ฆ", "["], - "]": ["ฬ", "ฑ", "]"], - "\\": ["ฯ", "ฌ", "\\"], - "a": ["ง", "ษ", "◌"], - "s": ["เ", "ถ", "๏"], - "d": ["ร", "แ", "๛"], - "f": ["น", "ช", "฿"], - "g": ["ม", "พ", ""], - "h": ["อ", "ผ", "ํ"], - "j": ["า", "ำ", "ๅ"], - "k": ["่", "ข", "ฃ"], - "l": ["้", "โ", ""], - ";": ["ว", "ภ", ";"], - "'": ["ื", "\"", "'"], - "z": ["ุ", "ฤ", "ฦ"], - "x": ["ไ", "ฝ", ""], - "c": ["ท", "ๆ", "๚"], - "v": ["ย", "ณ", ""], - "b": ["จ", "๊", ""], - "n": ["ค", "๋", "ฅ"], - "m": ["ี", "์", "๎"], - ",": ["ด", "ศ", ","], - ".": ["ะ", "ฮ", "."], - "/": ["ู", "?", "/"] + "`": ["`", "~", "`", ""], + "1": ["1", "!", "๑", ""], + "2": ["2", "@", "๒", ""], + "3": ["3", "#", "๓", ""], + "4": ["4", "$", "๔", ""], + "5": ["5", "%", "๕", ""], + "6": ["6", "^", "๖", ""], + "7": ["7", "&", "๗", ""], + "8": ["8", "*", "๘", ""], + "9": ["9", "(", "๙", ""], + "0": ["0", ")", "๐", ""], + "-": ["-", "_", "÷", ""], + "=": ["=", "+", "×", ""], + "q": ["ใ", "ฒ", "", ""], + "w": ["ต", "ฏ", "", ""], + "e": ["ห", "ซ", "", ""], + "r": ["ล", "ญ", "", ""], + "t": ["ส", "ฟ", "", ""], + "y": ["ป", "ฉ", "", ""], + "u": ["ั", "ึ", "ฺ", ""], + "i": ["ก", "ธ", "", ""], + "o": ["ิ", "ฐ", "", ""], + "p": ["บ", "ฎ", "", ""], + "[": ["็", "ฆ", "[", "{"], + "]": ["ฬ", "ฑ", "]", "}"], + "\\": ["ฯ", "ฌ", "\\", "|"], + "a": ["ง", "ษ", "◌", ""], + "s": ["เ", "ถ", "๏", ""], + "d": ["ร", "แ", "๛", ""], + "f": ["น", "ช", "฿", ""], + "g": ["ม", "พ", "", ""], + "h": ["อ", "ผ", "ํ", ""], + "j": ["า", "ำ", "ๅ", ""], + "k": ["่", "ข", "ฃ", ""], + "l": ["้", "โ", "", ""], + ";": ["ว", "ภ", ";", ":"], + "'": ["ื", "\"", "'", "\""], + "z": ["ุ", "ฤ", "ฦ", ""], + "x": ["ไ", "ฝ", "", ""], + "c": ["ท", "ๆ", "๚", ""], + "v": ["ย", "ณ", "", ""], + "b": ["จ", "๊", "", ""], + "n": ["ค", "๋", "ฅ", ""], + "m": ["ี", "์", "๎", ""], + ",": ["ด", "ศ", ",", "<"], + ".": ["ะ", "ฮ", ".", ">"], + "/": ["ู", "?", "/", "?"] } } diff --git a/main.ts b/main.ts index f961240..c3506e1 100644 --- a/main.ts +++ b/main.ts @@ -35,10 +35,15 @@ export class Layout { language: "Thai" @ArrayNotEmpty() - @IsIn(["Base", "Shift", "AltGr", "Command", "Option", "Control"], { - each: true, - }) - layers: Array<"Base" | "Shift" | "AltGr" | "Command" | "Option" | "Control"> + @IsIn( + ["Base", "Shift", "AltGr", "Command", "Option", "Control", "ShiftAltGr"], + { + each: true, + } + ) + layers: Array< + "Base" | "Shift" | "AltGr" | "Command" | "Option" | "Control" | "ShiftAltGr" + > @IsDefined() @IsNotEmptyObject() diff --git a/output/Manoonchai.keylayout b/output/Manoonchai.keylayout index 9b44806..43e7ea9 100644 --- a/output/Manoonchai.keylayout +++ b/output/Manoonchai.keylayout @@ -14,6 +14,9 @@ + + + @@ -259,10 +262,10 @@ - + - + @@ -343,5 +346,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/output/Manoonchai.klc b/output/Manoonchai.klc index badcd67..95e43bc 100644 Binary files a/output/Manoonchai.klc and b/output/Manoonchai.klc differ diff --git a/output/test.klc b/output/test.klc index badcd67..95e43bc 100644 Binary files a/output/test.klc and b/output/test.klc differ diff --git a/output/tmp.keylayout b/output/tmp.keylayout index 9b44806..9fd6b3c 100644 --- a/output/tmp.keylayout +++ b/output/tmp.keylayout @@ -14,6 +14,9 @@ + + + @@ -259,10 +262,10 @@ - + - + @@ -343,5 +346,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/main.test.ts b/test/main.test.ts index 801693a..c31fd4d 100644 --- a/test/main.test.ts +++ b/test/main.test.ts @@ -469,10 +469,11 @@ describe("generateKlc", () => { expect(lines[9]).toEqual(`6\t// Column 6 : AltGr`) // Assert Layout - expect(lines[10]).toEqual(`LAYOUT`) + const layoutLineIdx = lines.indexOf(`LAYOUT`) + expect(lines[layoutLineIdx]).toEqual(`LAYOUT`) - expect(lines[11]).toEqual(`0b\t0\t0\t0\t)\t๐`) - expect(lines[12]).toEqual(`02\t1\t0\t1\t!\t๑`) + expect(lines[layoutLineIdx + 1]).toEqual(`0b\t0\t0\t0\t)\t๐\t-1`) + expect(lines[layoutLineIdx + 2]).toEqual(`02\t1\t0\t1\t!\t๑\t-1`) // Assert ENDKBD expect(lines.slice(-1)).toEqual(["ENDKBD"])