;; cjk-util.mim -- Provide utilities for CJK input methods.
;; Copyright (C) 2005
;;   National Institute of Advanced Industrial Science and Technology (AIST)
;;   Registration Number H15PRO112

;; This file is part of the m17n library.

;; The m17n library is free software; you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
;; as published by the Free Software Foundation; either version 2.1 of
;; the License, or (at your option) any later version.

;; The m17n library is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
;; Lesser General Public License for more details.

;; You should have received a copy of the GNU Lesser General Public
;; License along with the m17n library; if not, write to the Free
;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.

(input-method t nil cjk-util)

(description "Provide utilities for CJK input methods.
This is acutually not a standalone input method, but is expected
to be included in the other input method (e.g. zh-py).

The fullwidth mode is turned on by typing \">>\", and turned off
by typing \"<<\".

The single fullwidth mode is turned on by typing \"Z\".  In this
mode, any key typed is converted to the fullwidth character and
is inserted, then the mode is turned off.
")

(map
 (fullwidth
  (" " ?　)  ("!" ?！)  ("\"" ?＂) ("#" ?＃)
  ("$" ("＄￠￡￥￦"))  ("%" ?％)  ("&" ?＆)  ("'" ?＇)
  ("(" ?\（) (")" ?\）) ("*" ?＊)  ("+" ?＋)
  ("," ?，)  ("-" ?－)  ("." ?．)  ("/" ?／)
  ("0" ?０)  ("1" ?１)  ("2" ?２)  ("3" ?３)
  ("4" ?４)  ("5" ?５)  ("6" ?６)  ("7" ?７)
  ("8" ?８)  ("9" ?９)  (":" ?：)  (";" ?；)
  ("<" ?＜)  ("=" ?＝)  (">" ?＞)  ("?" ?？)
  ("@" ?＠)  ("A" ?Ａ)  ("B" ?Ｂ)  ("C" ?Ｃ)
  ("D" ?Ｄ)  ("E" ?Ｅ)  ("F" ?Ｆ)  ("G" ?Ｇ)
  ("H" ?Ｈ)  ("I" ?Ｉ)  ("J" ?Ｊ)  ("K" ?Ｋ)
  ("L" ?Ｌ)  ("M" ?Ｍ)  ("N" ?Ｎ)  ("O" ?Ｏ)
  ("P" ?Ｐ)  ("Q" ?Ｑ)  ("R" ?Ｒ)  ("S" ?Ｓ)
  ("T" ?Ｔ)  ("U" ?Ｕ)  ("V" ?Ｖ)  ("W" ?Ｗ)
  ("X" ?Ｘ)  ("Y" ?Ｙ)  ("Z" ?Ｚ)  ("[" ?\［)
  ("\\" ?＼) ("]" ?\］) ("^" ?＾)  ("_" ?＿)
  ("`" ?｀)  ("a" ?ａ)  ("b" ?ｂ)  ("c" ?ｃ)
  ("d" ?ｄ)  ("e" ?ｅ)  ("f" ?ｆ)  ("g" ?ｇ)
  ("h" ?ｈ)  ("i" ?ｉ)  ("j" ?ｊ)  ("k" ?ｋ)
  ("l" ?ｌ)  ("m" ?ｍ)  ("n" ?ｎ)  ("o" ?ｏ)
  ("p" ?ｐ)  ("q" ?ｑ)  ("r" ?ｒ)  ("s" ?ｓ)
  ("t" ?ｔ)  ("u" ?ｕ)  ("v" ?ｖ)  ("w" ?ｗ)
  ("x" ?ｘ)  ("y" ?ｙ)  ("z" ?ｚ)  ("{" ?\｛)
  ("|" ?｜)  ("}" ?\｝) ("~" ?～)

  ((cent) ?￠)
  ((sterling) ?￡)
  ((notsign) ?￢)
  ((brokenbar) ?￤)
  ((yen) ?￥)
  ((Korean_Won) ?￦))

 (enter-fullwidth-mode
  (">>"))
 (exit-fullwidth-mode
  ("<<"))
 (enter-single-fullwidth-mode
  ("Z")))

(state
 (fullwidth-mode
  "Ａ"
  (fullwidth (commit))
  (exit-fullwidth-mode (shift t))
  (nil (unhandle)))

 (single-fullwidth-mode
  "Ａ"
  (fullwidth (commit) (shift t))))

;; Local Variables:
;; mode: lisp
;; coding: utf-8
;; End:
