Virtual keyboards¶
If some of your languages use non-ASCII characters, it might be a good idea to add a virtual keyboard. The user can enable or disable virtual keyboards for main language-dependent text boxes by clikcing on a keyboard sign. The virtual keyboard is based on the KioskBoard plugin.
This is how you can add virtual keyboards for all or some of your languages:
Add
keyboards
dictionary in corpus.json. Write language/tier names as keys and keyboard IDs as values.For each keyboard ID, you have to create a keyboard file in
/search/web_app/static/keyboards
. The files describe keyboards in JSON format. The file should be namedkeyboard-%KEYBOARD_ID%.json
. The file should contain a list where each element describes one row of keys. Each row contains a list of strings, one per key. Here is a small example:
1[
2 [
3 "w",
4 "e",
5 "ə",
6 "ɤ"
7 ],
8 [
9 "a",
10 "s",
11 "š",
12 "šʼ"
13 ],
14 [
15 "z",
16 "ž",
17 "žʼ"
18 ]
19]
If you have different input methods for some language, you can create different keyboards for different input methods. Name your keyboard files
keyboard-%KEYBOARD_ID%__%INPUT_METHOD_NAME%.json
. If Tsakorpus finds no file for a specific input method, it will look for a generic keyboard for that language.
The keyboards are assigned independently to text boxes in each query word, depending on the language/tier selected by the user for that particular word. The keyboard for the full-text search text box is assigned based on the language/tier of the first query word.