update readme and layout info

This commit is contained in:
Helium314 2024-01-26 20:42:39 +01:00
parent bd534bf5c0
commit 93dfecfe9e
2 changed files with 33 additions and 135 deletions

View file

@ -24,3 +24,18 @@ One special label that might be wanted though is `$$$`, which will be replaced b
* There is no need for specifying a code, it will be determined from the label automatically
* Specify it if you want key label and code to be different
* You can add a _labelFlag_ to a key for some specific effects, see [here](app/src/main/res/values/attrs.xml) in the section _keyLabelFlags_ for names and numeric values
* More details on the formal will be provided. For now you can check other layouts, often you just need to copy lines and change the labels.
## Adding new layouts / languages
* You need a layout file in one of the formats above, and add it to [layouts](app/src/main/assets/layouts)
* Add a layout entry to [method.xml](app/src/main/res/xml/method.xml)
* `KeyboardLayoutSet` must be set to the name of your layout file (without file ending)
* If you add a layout to an existing language, add a string with the layout name to use instead of `subtype_generic`. `%s` will be replaced with the language
* If you add a new language, you might want to provide a [language_key_texts](/app/src/main/assets/language_key_texts) file
* `[morekeys]` section contains popup keys that are similar to the letter (like `a` and `ä` or `य` and `य़`)
* Such forms should _not_ be in the layout. They will apply to all layouts of that language, even custom ones
* Use `%` to mark all preceding keys as "important" (ses the popup key order setting)
* The `punctuation` key is typically the period key. `morekeys` set here override the default.
* `[labels]` may contain non-default labels for the following keys `symbol`, `alphabet`, `shift_symbol`, `shift_symbol_tablet`, `comma`, `period`, `question`
* `[number_row]` may contain a custom number row (1-9 and 0 separated by space). You should also add the language to `numberRowLocales` in [`PreferencesSettingsFragment`](app/src/main/java/org/dslul/openboard/inputmethod/latin/settings/PreferencesSettingsFragment.java) so the user can opt into having a localized number row.
* `[extra_keys]` are typically keys shown in the default layout of the language. This is currently only used for latin layouts to avoid duplicating layouts for just adding few keys on the right side. The layout name need to end with `+`, but the `+` is removed when looking up the actual layout.