From 487755947e1cbc7206809935ed7c7872fe55e1b5 Mon Sep 17 00:00:00 2001 From: CuriousTorvald Date: Sun, 18 Sep 2022 22:40:00 +0900 Subject: [PATCH] Updated Keyboard Layout and IME (markdown) --- Keyboard-Layout-and-IME.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Keyboard-Layout-and-IME.md b/Keyboard-Layout-and-IME.md index cd4ee08..4430400 100644 --- a/Keyboard-Layout-and-IME.md +++ b/Keyboard-Layout-and-IME.md @@ -12,7 +12,7 @@ The layouts are stored in ` or /keylayout/` directory a **.key** files must be formatted as such: -``` +```javascript { "n":"US-Intl. Qwerty", // the name of the layout "capslock":"caps", // the capslock mode @@ -40,29 +40,29 @@ When an IME receives a key press, it can either *accept* or *reject* the key inp **.ime** files must be formatted as such: -``` +```javascript let states = { "keylayouts": ..., // same format as the .key files' "t" key "code": 0, // used internally. Write 1 if the character is being composed, 0 if not "hasDeadKey": false, // if this keyboard layout has deadkeys } // note: the states object is technically optional, but you *will* want to use it return Object.freeze({ - "n":"두벌식 표준", // the name of the layout - "v":"none", // candidate mode. "many" for layouts that require candidates (e.g. Chinese and Japanse), "none" if candidates are not required - "c":"CuriousTo\uA75Bvald", // the copyright string - "m":"rewrite", // the operation mode. Use one of "rewrite" or "candidates" - "t":states.keylayouts.map(it => [it[0],it[1]]), // keyboard layout. Only used by the ingame config UI to show the layout info - "l":"koKR", // the language associated with the layout + "n": "두벌식 표준", // the name of the layout + "v": "none", // candidate mode. "many" for layouts that require candidates (e.g. Chinese and Japanse), "none" if candidates are not required + "c": "CuriousTo\uA75Bvald", // the copyright string + "m": "rewrite", // the operation mode. Use one of "rewrite" or "candidates" + "t": states.keylayouts.map(it => [it[0],it[1]]), // keyboard layout. Only used by the ingame config UI to show the layout info + "l": "koKR", // the language associated with the layout "accept": (headkey, shiftin, altgrin) => { - ... + /* more codes here */ return [arg, keysymbol] }, // a function that accepts a key input that returns an array "backspace": () => { - ... + /* more codes here */ return keysymbol }, // a function that is called when the backspace key was down that returns a Key Symbol "end": () => { - ... + /* more codes here */ return keysymbol }, // a function that is called when a composing is being cancelled that returns a Key Symbol "reset": () => { ... }, // a function that resets the IME's internal state