1khim(n) Kevin's Hacky Input Method khim(n)
2
3
4
5______________________________________________________________________________
6
8 khim - Provides key bindings for entering international characters on a
9 keyboard that does not support them
10
12 package require Tcl
13
14 package require khim ?1.0?
15
16 ::khim::getOptions path
17
18 ::khim::getConfig
19
20 ::khim::setConfig version enabled compose map
21
22 ::khim::showHelp path
23
24_________________________________________________________________
25
27 This package provides a set of key bindings to allow a user to enter
28 arbitrary characters on a keyboard that does not support them. It
29 works by designating some seldom-used key of the keyboard as a "Com‐
30 pose" key (this key is distinct from any key so labeled, and is often
31 "Pause," "F12" or "L2"), and having the "Compose" key, followed by a
32 two-key sequence, have the effect of inserting some character in a wid‐
33 get. In addition, the "Compose" key, when struck twice in succession,
34 brings up a dialog containing a Unicode character map, allowing arbi‐
35 trary characters to be inserted.
36
37 The vast bulk of the package's functionality is implemented in a single
38 bindtag, KHIM. An application can request that any text or entry wid‐
39 get use the package to allow for entry of arbitrary characters by plac‐
40 ing this binding tag ahead of the Text or Entry binding tag for the
41 widget:
42
43 text .t -width 80 -height 24
44 bindtags .t {.t KHIM Text . all}
45
46
47 Note that the KHIM tag must precede the Text or Entry class binding, or
48 the package will not function correctly.
49
50
51
53 In addition to commands supporting the KHIM binding tag, the following
54 commands are exported from the package:
55
56
57
58
59
60 ::khim::getOptions path
61
62
63 Posts a top-level modal dialog with the path name path that
64 prompts the user for KHIM options. The user is allowed to
65 reconfigure the key sequences for the "Compose" key, change the
66 choice of key to use for the "Compose" function, and enable/dis‐
67 able the KHIM key bindings entirely.
68
69
70
71 ::khim::getConfig
72
73
74 Returns a Tcl script that restores the current configuration of
75 KHIM: the enabled/disabled state, the choice of "Compose" key,
76 and the key sequences that may be composed. This script is
77 designed to be saved to a configuration file for use in a subse‐
78 quent invocation of the same application:
79
80
81
82
83 # Save KHIM configuration
84 set f [open ~/.khimrc w]
85 puts $f [::khim::getConfig]
86 close $f
87
88 # Restore KHIM configuration
89 source ~/.khimrc
90
91
92 ::khim::setConfig version enabled compose map
93 Restores an earlier saved configuration. Few, if any, applica‐
94 tions will call this command in any other way than to evaluate
95 it as returned from ::khim::getConfig.
96
97 ::khim::showHelp path
98 Displays a top-level dialog giving user-level help for KHIM; the
99 dialog will have the path name path.
100
102 Programmers who wish to make KHIM available in a non-English-speaking
103 locale may do so by providing a .msg file with the appropriate
104 localised text. The catalog requires the following messages:
105
106 Apply Text that will appear on the "Apply" button in the dialog that
107 sets KHIM options.
108
109 Cancel Text that will appear on the "Cancel" button in several dialogs.
110
111 Change Text that will appear on the "Change" button, which alters the
112 binding of a pair of composed characters (creating or replacing
113 as appropriate).
114
115 Character
116 Text that will appear on the label of the entry widget that
117 accepts a character resulting from a composed sequence.
118
119 {Compose Key}
120 Window title for a dialog that prompts the user to strike the
121 key that will be used for the "Compose" key.
122
123 {Compose key:}
124 Label that identifies a component showing the "Compose" key
125 choice in the KHIM options dialog.
126
127 {Composed sequence must be two characters long}
128 Error message that is displayed if the user attempts to define a
129 "Compose" sequence that is shorter or longer than two charac‐
130 ters.
131
132 Delete Text for a button that deletes a "Compose" sequence.
133
134 Help...
135 Text for a button that displays the KHIM user help dialog.
136
137 HELPTEXT
138 Complete text for the user-level help for KHIM. Refer to
139 "en.msg" for the English-language version of the help.
140
141 {Input key sequence}
142 Text for a label of the entry widget that prompts the user for a
143 two-character sequence to use with the "Compose" key.
144
145 {Insert Character}
146 Window title of the dialog box that displays a Unicode character
147 map and prompts the user to select a character to insert.
148
149 {Key sequences}
150 Text for a label at the head of a listbox showing the composed
151 sequences that are currently bound.
152
153 {KHIM Controls}
154 Window title for the dialog box that prompts for KHIM settings.
155
156 {KHIM Help}
157 Window title for the window that display help text for KHIM.
158
159 OK Label for the OK button on several dialogs.
160
161 Select code page:
162 Label for a spinbox that prompts the user for a Unicode code
163 page number.
164
165 SELECT COMPOSE KEY
166 A message, which should be composed in short lines, prompting
167 the user to press the key that will become the "Compose" key in
168 KHIM.
169
170 Unicode...
171 Text for a button that brings up the character map to select the
172 character to which a composed sequence binds.
173
174 {Use KHIM}
175 Text for a checkbutton that asks whether the user wishes to use
176 KHIM to manage composed key sequences.
177
179 KHIM was originally inspired by the key bindings that Brent Welch
180 developed for the 'sedit' editor used in the 'exmh' mail user agent.
181 The code for KHIM is entirely separate from that for 'sedit'.
182
184 character, i18n, input, international, method
185
186
187
188khim 1.0 khim(n)