• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..07-May-2022-

act/H16-Sep-2018-728720

act09/H16-Sep-2018-910800

azik/H16-Sep-2018-571562

default/H16-Sep-2018-353345

kzik/H16-Sep-2018-596587

nicola/H16-Sep-2018-254204

tcode/H16-Sep-2018-1,3961,389

trycode/H16-Sep-2018-3,2853,276

tutcode/H16-Sep-2018-2,6812,674

tutcode-touch16x/H16-Sep-2018-5447

Makefile.amH A D03-May-20223.8 KiB143114

README.rulesH A D16-Sep-20184.1 KiB171130

README.rules

1* Rules overview
2
3libskk supports various typing rules such as AZIK, ACT, TUT-Code,
4which define keyboard shortcuts and romaji-to-kana conversion table.
5Rules are normally read from ~/.config/libskk/rules and
6/usr/share/libskk/rules.
7
8* Rule directory structure
9
10A rule consists of the following directory structure:
11
12<root>
13  metadata.json
14  keymap/
15    <map-file>
16    ...
17  rom-kana/
18    <map-file>
19    ...
20
21* Rule metadata
22
23Each rule must have metadata.json in the top level directory, with the
24following content:
25
26{
27  "name": <name of the rule>,
28  "description": <description of the rule>,
29  "filter": <name of the optional keyboard filter (mainly used by NICOLA)>
30}
31
32
33* Format of map files
34
35Each file under keymaps/ and rom-kana/ directories is used to define
36some key-value mappings.  They are in the following format:
37
38{
39  "include": [
40    <parent>,
41    ...
42  ],
43  "define": {
44    <map>: {
45      <key>: <value>,
46      ...
47    },
48    ...
49  }
50}
51
52The value associated with "include" is an array of parent map files,
53which will be included before evaluating the map file itself.  The
54value associated with "define" is an object which binds some variables
55to values.
56
57** Path name resolution
58
59Each element in "include" may be either a relative or absolute path.
60
61A relative path does not include "/" while absolute one does.
62
63If path is relative, the map file is located under the same directory
64of the current map file.  Otherwise, libskk looks for the map file
65outside of the diretory where the current map file is located.
66
67Example:
68
69If the current map file is <root>/foo/rom-kana/foo.json and it contains:
70
71  "include": [ "default" ]
72
73it looks for <root>/foo/rom-kana/default.json.
74
75If the current map file is <root>/foo/rom-kana/bar.json and it contains:
76
77  "include": [ "default/default" ]
78
79it looks for <root>/default/rom-kana/default.json.
80
81** Format of keymap rule files
82
83The map name "keymap" is used to associate a key event to a command name.
84
85Example:
86
87{
88  "include": [
89    "default"
90  ],
91  "define": {
92    "keymap": {
93      "Q": null,
94      "C-@": "start-preedit"
95    }
96  }
97}
98
99This map file includes "default" map file first, replace mapping of
100"start-preedit" from "Q" to "C-@" (control + "@").
101
102The current available commands are:
103
104abbrev
105abort
106abort-to-latin
107abort-to-latin-unhandled
108commit
109commit-unhandled
110complete
111delete
112insert-kana-<kana>
113kuten
114next-candidate
115previous-candidate
116set-input-mode-<mode>
117special-midasi
118start-preedit
119start-preedit-kana
120start-preedit-no-delete
121upper-<lower>
122
123** Format of rom-kana map files
124
125The map name "rom-kana" is used to define romaji-to-kana conversion
126tables.  The value is an object which maps a string to either an array
127or null.
128
129If the value is an array, a new mapping is defined.  In that case each
130array can contain 2 to 4 elements.  The first two elements are
131<carryover> and <hiragana>.  <carryover> is a string which will be
132added to preedit after the transition (for example, when "bb" is
133typed, "b" is <carryover> which will be added to the next preedit).
134<hiragana> is an output in hiragana.  The rest of those elements are
135<katakana> and <hankaku-katakana>, which are optional output strings
136in katakana and hankaku-katakana input mode (automatically derived
137from <hiragana> if they are omitted).
138
139If the value is null, existing mapping of the corresponding key is
140removed from the parent map file.
141
142Example:
143
144{
145  "include": [
146    "default"
147  ],
148  "define": {
149    "rom-kana": {
150      "xka": [ "", "か", "ヵ", "カ" ],
151      "b.": [ "", "ぶ" ],
152      "dha": null
153    }
154  }
155}
156
157This map file includes "default" map file first, defines new mappings
158for "xka" and "b.", and removes a mapping "dha" from the current map
159file.
160
161Copyright (C) 2011-2018 Daiki Ueno <ueno@gnu.org>
162Copyright (C) 2011-2018 Red Hat, Inc.
163
164This file is free software; as a special exception the author gives
165unlimited permission to copy and/or distribute it, with or without
166modifications, as long as this notice is preserved.
167
168This file is distributed in the hope that it will be useful, but
169WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
170implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
171