Skip to content

Commit 85c73d9

Browse files
committed
CONTRIBUTING.md: Update section on srcs/compose
1 parent 58dabfa commit 85c73d9

File tree

1 file changed

+39
-11
lines changed

1 file changed

+39
-11
lines changed

CONTRIBUTING.md

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -190,18 +190,46 @@ As translations need to be updated regularly, you can subscribe to this issue
190190
to receive a notification when an update is needed:
191191
https://github.com/Julow/Unexpected-Keyboard/issues/373
192192

193-
### Adding Compose key sequences
193+
### Adding symbols to Shift, Fn, Compose and other modifiers
194194

195-
New Compose sequences can be added into `srcs/compose/compose/extra.json`.
196-
If a entirely new family of sequences were to be added, a new `.json` file can
197-
be created in the same directory to host them.
195+
New key combinations can be added to builtin modifiers in the following files:
198196

199-
### Adding key combinations
197+
- Shift in `srcs/compose/shift.json`.
198+
- Fn in `srcs/compose/fn.json`.
199+
- Compose in `srcs/compose/compose/extra.json`.
200+
- Other modifiers are defined in the `accent_*.json` files in `srcs/compose`.
200201

201-
Key combinations are defined in `srcs/juloo.keyboard2/KeyModifier.java`.
202-
For example, keys modified by the `Fn` key are defined in method
203-
`apply_fn_char`.
202+
Generated code must then be updated by running:
204203

205-
Keys with special meaning are defined in `KeyValue.java` in method
206-
`getKeyByName`. Their special action are defined in `KeyEventHandler.java` in
207-
method `key_up`
204+
```
205+
./gradlew compileComposeSequences
206+
```
207+
208+
These files describe each symbols that get transformed when a given modifier is
209+
activated, in JSON format. For example:
210+
211+
Example from `fn.json`, when `Fn` is activated, `<` becomes `«`:
212+
```json
213+
{
214+
"<": "«",
215+
}
216+
```
217+
218+
The result of a sequence can be a key name. See the list of key names in
219+
[doc/Possible-key-values.md](doc/Possible-key-values.md). For example from
220+
`fn.json`, when `Fn` is activated, space becomes `nbsp`:
221+
```json
222+
{
223+
" ": "nbsp",
224+
}
225+
```
226+
227+
Compose sequences are made of several steps. For example, the sequence
228+
`Compose V s = Š` is defined as:
229+
```json
230+
{
231+
"V": {
232+
"s": "Š"
233+
}
234+
}
235+
```

0 commit comments

Comments
 (0)