From d8c01d904f89dbb369fcd99586d337126d81e442 Mon Sep 17 00:00:00 2001 From: BlackyHawky Date: Wed, 9 Oct 2024 10:05:17 +0200 Subject: [PATCH] Updated Layouts (markdown) --- Layouts.md | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/Layouts.md b/Layouts.md index e97b4ae..31b8422 100644 --- a/Layouts.md +++ b/Layouts.md @@ -197,8 +197,29 @@ Usually the label is what is displayed on the key. However, there are some speci -* In case a label clashes with the text you want to add, put a `\\` in front of the text you want, e.g. `{ "label": "\\space" }` will write the label `space` instead of adding a space bar. - * Note that you need to escape the `\` in json files by adding a second `\`. +* In case a label clashes with the text you want to add, put `\\` in front of the text you want, e.g. `{ "label": "\\space" }` will write the label `space` instead of adding a space bar. + * Note that you need to escape the `\` in json files by adding a second `\`.
+ This means: + * If you wish to add `\` character, you must add a second `\` in json files + * The same applies to the `"` character: you must add a `\` in json files +

+
+ Click to see example with `\` character +
+ + ```json + // The `\` character is displayed on the key + { "label": "\\", "width": 0.1, "type": "normal", "popup": { "relevant": + [ + // The `"` character is displayed in the popup + { "label": "\"" } + ] } + }, + // The word `space` is displayed on the key + { "label": "\\space", "width": 0.1 } + ``` +
+ * If you want different key label and input text, set the label to [label]|[text], e.g. `{ "label": "aa|bb" }` will show `aa` on the key, but pressing it will input `bb`. * You can also specify special key codes like `{ "label": "a|!code/key_shift" }` @@ -403,6 +424,25 @@ Here are the different classes: +* Reminder:
+ If you wish to add `\` character, you must add a second `\` in json files
+ The same applies to the `"` character: you must add a `\` in json files + +
+ Click to see example with `\` character +
+ + ```json + // The `\` character is displayed on the key + { "label": "\\", "width": 0.1, "type": "normal", "popup": { "relevant": + [ + // The `"` character is displayed in the popup + { "label": "\"" } + ] } + } + ``` +
+ # Examples of JSON files [Here](https://github.com/Helium314/HeliBoard/discussions/1132#discussion-7260853) are some sample JSON files that customize all the keyboard views. \ No newline at end of file