1 ;; zh-util.mim -- Provide utilities for Chinese input methods.
3 ;; National Institute of Advanced Industrial Science and Technology (AIST)
4 ;; Registration Number H15PRO112
6 ;; This file is part of the m17n library.
8 ;; The m17n library is free software; you can redistribute it and/or
9 ;; modify it under the terms of the GNU Lesser General Public License
10 ;; as published by the Free Software Foundation; either version 2.1 of
11 ;; the License, or (at your option) any later version.
13 ;; The m17n library is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 ;; Lesser General Public License for more details.
18 ;; You should have received a copy of the GNU Lesser General Public
19 ;; License along with the m17n library; if not, write to the Free
20 ;; Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
23 (input-method t nil zh-util)
25 (description "Provide utilities for Chinese input methods.
26 This is acutually not a standalone input method, but is expected
27 to be included in the other Chinese input method (e.g. zh-py).
31 ;; Typing 1, 2, ..., 0 selects the 0th, 1st, ..., 9th candidate.
55 ;; When an input spot is moved, commit the current predit by shifting
57 ((input-focus-move) (shift init))
58 ;; When an input focus is out or in, keep the current preedit.
59 ((input-focus-out) (set KK @@) (sub KK 1) (undo KK))
60 ((input-focus-in) (set KK @@) (sub KK 1) (undo KK)))
70 ;; When Backspace is typed, cancel the last input.
73 ;; When anything else is typed, produce the current candidate (if
74 ;; any), and re-handle the last input in "init" state.
75 (nil (hide) (shift init)))
78 (t (set K @@) (sub K 1))
79 ;; When a number is typed, select the corresponding canidate,
80 ;; produce it, and shift to "init" state.
82 (choose (hide) (shift init))
85 ;; When key to force committing, commit the current preedit.
86 (commit-preedit (shift init))
87 ;; When anything else is typed, produce the current candidate,
88 ;; and re-handle the last input in "init" state.
89 (nil (hide) (shift init))))