Updated Keyboard Layout and IME (markdown)

CuriousTorvald
2022-09-18 22:40:00 +09:00
parent 4b191ca835
commit 487755947e

@@ -12,7 +12,7 @@ The layouts are stored in `<assets> or <module base dir>/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,7 +40,7 @@ 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
@@ -54,15 +54,15 @@ return Object.freeze({
"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