2017-11-10 14:26:48 +00:00
|
|
|
Gnome-shell OSK layouts are extracted from CLDR layout definitions:
|
|
|
|
https://www.unicode.org/cldr/charts/latest/keyboards/layouts/index.html
|
|
|
|
|
2022-04-22 21:52:16 +00:00
|
|
|
To add new layouts from CLDR:
|
2017-11-10 14:26:48 +00:00
|
|
|
|
2022-04-22 21:52:16 +00:00
|
|
|
1) Run update-osk-layouts.sh
|
2017-11-10 14:26:48 +00:00
|
|
|
|
2022-04-22 21:52:16 +00:00
|
|
|
2) Modify JSON files to add extra keys, tweak appearance...
|
2017-11-10 14:26:48 +00:00
|
|
|
|
2022-04-22 21:52:16 +00:00
|
|
|
2) Do git add and git commit
|
2017-11-10 14:26:48 +00:00
|
|
|
|
2022-04-22 21:52:16 +00:00
|
|
|
JSON file format
|
|
|
|
================
|
2017-11-10 14:26:48 +00:00
|
|
|
|
2022-04-22 21:52:16 +00:00
|
|
|
Each JSON file describes a keymap for a certain language and layout,
|
|
|
|
it has the following structure:
|
2017-11-10 14:26:48 +00:00
|
|
|
|
2022-04-22 21:52:16 +00:00
|
|
|
- Root (Object)
|
2017-11-10 14:26:48 +00:00
|
|
|
|
2022-04-22 21:52:16 +00:00
|
|
|
Root object of a layout, has the following properties:
|
2017-11-10 14:26:48 +00:00
|
|
|
|
2022-04-22 21:52:16 +00:00
|
|
|
- levels (Array of Level): Levels in the keymap
|
|
|
|
- locale (String): Locale name for this keymap
|
|
|
|
- name (String): Human readable name for this keymap
|
2017-11-10 14:26:48 +00:00
|
|
|
|
2022-04-22 21:52:16 +00:00
|
|
|
- Level (Object)
|
2017-11-10 14:26:48 +00:00
|
|
|
|
2022-04-22 21:52:16 +00:00
|
|
|
A level defines the keys available on a keyboard level,
|
|
|
|
these are the key panels visible at a time. E.g. to type
|
|
|
|
uppercase levels or symbols.
|
2017-11-10 14:26:48 +00:00
|
|
|
|
2022-04-22 21:52:16 +00:00
|
|
|
Levels have the following properties:
|
2017-11-10 14:26:48 +00:00
|
|
|
|
2022-04-22 21:52:16 +00:00
|
|
|
- level (String): Name of the level, common names are
|
|
|
|
"", "shift", "opt" and "opt+shift".
|
|
|
|
- mode (String): Mode for this level, common modes are
|
|
|
|
"default", "latched" and "locked".
|
|
|
|
- rows (Array of Row): Array of rows of keys.
|
|
|
|
|
|
|
|
- Row (Array)
|
|
|
|
|
|
|
|
A row is an Array of Key.
|
|
|
|
|
|
|
|
- Key (Object)
|
|
|
|
|
|
|
|
A keyboard key. Keys have the following properties:
|
|
|
|
|
|
|
|
- iconName (String): Icon name to show on the key.
|
|
|
|
Keys with an icon name do not have a label.
|
|
|
|
- label (String): Label to show on the key.
|
|
|
|
- strings (Array of String): Strings to commit. If
|
|
|
|
label property does not exist, the first element
|
|
|
|
will be also the label. Extra elements are shown
|
|
|
|
in the extra keys popover.
|
|
|
|
- keyval (String): Hexadecimal keyval to emit as
|
|
|
|
emulated key presses. Committed strings are
|
|
|
|
preferred.
|
|
|
|
- width (Double): Relative width of the key in the
|
|
|
|
row. 1 is for a square key. Multiples of 0.5 are
|
|
|
|
accepted.
|
|
|
|
- level (Integer): Level that the key switches to.
|
|
|
|
See the levelSwitch action.
|
|
|
|
- action (string): Action performed by the key,
|
|
|
|
accepted actions are:
|
|
|
|
|
|
|
|
- hide: Hides the OSK
|
|
|
|
- languageMenu: Pops up the language selection
|
|
|
|
menu
|
|
|
|
- emoji: Switches to the emoji selection panel
|
|
|
|
- modifier: Handles the keyval as a modifier
|
|
|
|
key. This handles e.g. Ctrl+A as a sequence
|
|
|
|
of Ctrl press, A press, A release, Ctrl
|
|
|
|
release.
|
|
|
|
- delete: Deletes text backwards
|
|
|
|
- levelSwitch: Switches OSK to a different level
|