mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2025-06-19 17:31:30 +02:00
CONTRIBUTING.md: Update section on srcs/compose
This commit is contained in:
parent
58dabfaa07
commit
85c73d9f62
@ -190,18 +190,46 @@ As translations need to be updated regularly, you can subscribe to this issue
|
|||||||
to receive a notification when an update is needed:
|
to receive a notification when an update is needed:
|
||||||
https://github.com/Julow/Unexpected-Keyboard/issues/373
|
https://github.com/Julow/Unexpected-Keyboard/issues/373
|
||||||
|
|
||||||
### Adding Compose key sequences
|
### Adding symbols to Shift, Fn, Compose and other modifiers
|
||||||
|
|
||||||
New Compose sequences can be added into `srcs/compose/compose/extra.json`.
|
New key combinations can be added to builtin modifiers in the following files:
|
||||||
If a entirely new family of sequences were to be added, a new `.json` file can
|
|
||||||
be created in the same directory to host them.
|
|
||||||
|
|
||||||
### Adding key combinations
|
- Shift in `srcs/compose/shift.json`.
|
||||||
|
- Fn in `srcs/compose/fn.json`.
|
||||||
|
- Compose in `srcs/compose/compose/extra.json`.
|
||||||
|
- Other modifiers are defined in the `accent_*.json` files in `srcs/compose`.
|
||||||
|
|
||||||
Key combinations are defined in `srcs/juloo.keyboard2/KeyModifier.java`.
|
Generated code must then be updated by running:
|
||||||
For example, keys modified by the `Fn` key are defined in method
|
|
||||||
`apply_fn_char`.
|
|
||||||
|
|
||||||
Keys with special meaning are defined in `KeyValue.java` in method
|
```
|
||||||
`getKeyByName`. Their special action are defined in `KeyEventHandler.java` in
|
./gradlew compileComposeSequences
|
||||||
method `key_up`
|
```
|
||||||
|
|
||||||
|
These files describe each symbols that get transformed when a given modifier is
|
||||||
|
activated, in JSON format. For example:
|
||||||
|
|
||||||
|
Example from `fn.json`, when `Fn` is activated, `<` becomes `«`:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"<": "«",
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
The result of a sequence can be a key name. See the list of key names in
|
||||||
|
[doc/Possible-key-values.md](doc/Possible-key-values.md). For example from
|
||||||
|
`fn.json`, when `Fn` is activated, space becomes `nbsp`:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
" ": "nbsp",
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Compose sequences are made of several steps. For example, the sequence
|
||||||
|
`Compose V s = Š` is defined as:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"V": {
|
||||||
|
"s": "Š"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user