;; ko-romaja.mim -- Input method for Korean Hangul with Romaja keys.
-;; Copyright (C) 2004
+;; Copyright (C) 2004, 2005
;; National Institute of Advanced Industrial Science and Technology (AIST)
;; Registration Number H15PRO112
;; Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
;; 02111-1307, USA.
-;;; <li> ko-romaja.mim
-;;;
;;; Input method for Korean Hangul using Romaja keys. The
;;; roman-transliteration rules follows that of IIIMF shown in this
;;; page: http://www3.sympatico.ca/d.moser/hangul.html
+(input-method ko romaja)
+
+(description
+ "Hangul input method with romaja keys.
+The roman-transliteration rules follows that of IIIMF shown in
+the page <http://www3.sympatico.ca/d.moser/hangul.html>.
+
+Common to CHOSEONG and JONGSEONG:
+ ㄱ(g) ㄲ(gg,kk,qq,c) ㄴ(n) ㄷ(d) ㄹ(l) ㄹ(r) ㅁ(m) ㅂ(b,v) ㅅ(s)
+ ㅆ(ss) ㅇ(ng) ㅇ(x) ㅈ(j) ㅊ(ch) ㅋ(k,q) ㅌ(t) ㅍ(p,f) ㅎ(h)
+
+CHOSEONG:
+ ㄸ(dd,tt) ㅃ(bb,vv) ㅉ(jj)
+
+JONGSEONG:
+ ㄳ(gs) ㄵ(nj) ㄶ(nh) ㄺ(lg) ㄻ(lm) ㄼ(lb) ㄽ(ls) ㄾ(lt) ㄿ(lp) ㅀ(lh) ㅄ(bs)
+
+JUNGSEONG:
+ ㅏ(a) ㅐ(ai,ae) ㅑ (ya,ia) ㅒ(yai,yae,iae) ㅓ(eo) ㅔ(e,eoi) ㅕ(yeo,ieo)
+ ㅖ(ye,ie,yeoi) ㅗ(o) ㅘ(oa,wa,ua) ㅙ(oai,wae,uae,oae) ㅚ(oi,woe,uoe,oe)
+ ㅛ(yo,io) ㅜ(u,w,oo) ㅝ(ueo,wo,uo) ㅞ(ue,we) ㅟ(wi) ㅠ(yu,iu) ㅡ(eu)
+ ㅢ(eui,ui) ㅣ(i,y,ee)
+
+Special:
+ Type uppercase letter to specify CHOSEONG explicitly.
+ Type \"I\" to toggle the composed-syllable mode and isolated-jamo mode.
+ Type \">>\" to fullwidth ASCII letter mode, \"<<\" to shift out the mode.
+ Type \"Z\" and a key to input fullwidth version of the key.
+")
+
(title "로마자")
(macro
(delete @<)
(insert S))))
- ;; If L is not negatice, convert Jame sequence LV to a precomposed
+ ;; If L is not negative, convert Jame sequence LV to a precomposed
;; character while assuming T is 0x11A7. If L is 0 (i.e. missing),
;; set L to 0x110B.
(compose-vowel
(set T T1)))))
(map
- ;; Common keys for CHOSEONG and JONGSEONG.
- ;; Set L1 to CHOSEONG, T to JONGSEONG, insert a Compatibility Jamo.
+ ;; This map is used only in init state, which means typing these
+ ;; uppercase letters in any other states causes shifting to init
+ ;; state, and they are re-handled in init state.
+ (uppercase
+ ("B" (pushback "b")) ("C" (pushback "c")) ("D" (pushback "d"))
+ ("F" (pushback "f")) ("G" (pushback "g")) ("H" (pushback "h"))
+ ("J" (pushback "j")) ("K" (pushback "k")) ("L" (pushback "l"))
+ ("M" (pushback "m")) ("N" (pushback "n")) ("P" (pushback "p"))
+ ("Q" (pushback "q")) ("R" (pushback "r")) ("S" (pushback "s"))
+ ("T" (pushback "t")) ("V" (pushback "v")) ("X" (pushback "x")))
+
+ ;; Keys common to CHOSEONG and JONGSEONG. Set L1 to CHOSEONG, T to
+ ;; JONGSEONG, insert a Compatibility Jamo. When this map is used in
+ ;; init state, L is still 0, thus compose macro does nothing.
+ ;; Otherwise, L is already set to a CHOSEONG, thus compose macro
+ ;; composes LVT into a syllable.
(X
("g" (set L1 0x1100) (set T 0x11A8) ?ㄱ (compose))
("gg" (set L1 0x1101) (set T 0x11A9) ?ㄲ (compose))
- ("G" (set L1 0x1101) (set T 0x11A9) ?ㄲ (compose))
- ("n" (set L1 0x1102) (set T 0x11AB) ?ㄲ (compose))
+ ("kk" (set L1 0x1101) (set T 0x11A9) ?ㄲ (compose))
+ ("qq" (set L1 0x1101) (set T 0x11A9) ?ㄲ (compose))
+ ("c" (set L1 0x1101) (set T 0x11A9) ?ㄲ (compose))
+ ("n" (set L1 0x1102) (set T 0x11AB) ?ㄴ (compose))
("d" (set L1 0x1103) (set T 0x11AE) ?ㄷ (compose))
+ ("l" (set L1 0x1105) (set T 0x11AF) ?ㄹ (compose))
+ ("r" (set L1 0x1105) (set T 0x11AF) ?ㄹ (compose))
("m" (set L1 0x1106) (set T 0x11B7) ?ㅁ (compose))
("b" (set L1 0x1107) (set T 0x11B8) ?ㅂ (compose))
+ ("v" (set L1 0x1107) (set T 0x11B8) ?ㅂ (compose))
("s" (set L1 0x1109) (set T 0x11BA) ?ㅅ (compose))
("ss" (set L1 0x110A) (set T 0x11BB) ?ㅆ (compose))
+ ("ng" (set L1 0x110B) (set T 0x11BC) ?ㅇ (compose))
+ ("x" (set L1 0x110B) (set T 0x11BC) ?ㅇ (compose))
("j" (set L1 0x110C) (set T 0x11BD) ?ㅈ (compose))
- ("z" (set L1 0x110C) (set T 0x11BD) ?ㅈ (compose))
("ch" (set L1 0x110E) (set T 0x11BE) ?ㅊ (compose))
("k" (set L1 0x110F) (set T 0x11BF) ?ㅋ (compose))
+ ("q" (set L1 0x110F) (set T 0x11BF) ?ㅋ (compose))
("t" (set L1 0x1110) (set T 0x11C0) ?ㅌ (compose))
("p" (set L1 0x1111) (set T 0x11C1) ?ㅍ (compose))
+ ("f" (set L1 0x1111) (set T 0x11C1) ?ㅍ (compose))
("h" (set L1 0x1112) (set T 0x11C2) ?ㅎ (compose)))
- ;; Keys starting X.
- (X-head
- ("g") ("G") ("n") ("d") ("m") ("b") ("s") ("j") ("z") ("c")
- ("k") ("t") ("p") ("h"))
-
;; Keys only for CHOSEONG.
;; Set L to CHOSEONG, insert a Compatibility Jamo.
(L
("dd" (set L 0x1104) ?ㄸ)
- ("D" (set L 0x1104) ?ㄸ)
- ("r" (set L 0x1105) ?ㄹ)
+ ("tt" (set L 0x1104) ?ㄸ)
("bb" (set L 0x1108) ?ㅃ)
- ("B" (set L 0x1108) ?ㅃ)
- ("S" (set L 0x110A) ?ㅆ)
- ("jj" (set L 0x110D) ?ㅉ)
- ("J" (set L 0x110D) ?ㅉ)
- ("zz" (set L 0x110D) ?ㅉ)
- ("Z" (set L 0x110D) ?ㅉ)
- ("q" (set L 0x110F) ?ㅋ))
+ ("vv" (set L 0x1108) ?ㅃ)
+ ("jj" (set L 0x110D) ?ㅉ))
;; Keys only for JONGSEONG.
;; Set T to JONGSEONG, insert a Compatibility Jamo.
("gs" (set T 0x11AA) ?ㄳ (compose))
("nj" (set T 0x11AC) ?ㄵ (compose))
("nh" (set T 0x11AD) ?ㄶ (compose))
- ("l" (set T 0x11AF) ?ㄹ (compose))
("lg" (set T 0x11B0) ?ㄺ (compose))
("lm" (set T 0x11B1) ?ㄻ (compose))
("lb" (set T 0x11B2) ?ㄼ (compose))
("lt" (set T 0x11B4) ?ㄾ (compose))
("lp" (set T 0x11B5) ?ㄿ (compose))
("lh" (set T 0x11B6) ?ㅀ (compose))
- ("bs" (set T 0x11B9) ?ㅄ (compose))
- ("ng" (set T 0x11BC) ?ㅇ (compose)))
+ ("bs" (set T 0x11B9) ?ㅄ (compose)))
;; Keys only for JUNGSEONG.
;; Set V to JUNGSEONG, insert a Compatibility Jamo.
("ai" (set V 0x1162) ?ㅐ (compose-vowel))
("ae" (set V 0x1162) ?ㅐ (compose-vowel))
("ya" (set V 0x1163) ?ㅑ (compose-vowel))
+ ("ia" (set V 0x1163) ?ㅑ (compose-vowel))
("yai" (set V 0x1164) ?ㅒ (compose-vowel))
("yae" (set V 0x1164) ?ㅒ (compose-vowel))
+ ("iae" (set V 0x1164) ?ㅒ (compose-vowel))
("eo" (set V 0x1165) ?ㅓ (compose-vowel))
("e" (set V 0x1166) ?ㅔ (compose-vowel))
("eoi" (set V 0x1166) ?ㅔ (compose-vowel))
("yeo" (set V 0x1167) ?ㅕ (compose-vowel))
+ ("ieo" (set V 0x1167) ?ㅕ (compose-vowel))
("ye" (set V 0x1168) ?ㅖ (compose-vowel))
+ ("ie" (set V 0x1168) ?ㅖ (compose-vowel))
("yeoi"(set V 0x1168) ?ㅖ (compose-vowel))
("o" (set V 0x1169) ?ㅗ (compose-vowel))
("oa" (set V 0x116A) ?ㅘ (compose-vowel))
("wa" (set V 0x116A) ?ㅘ (compose-vowel))
+ ("ua" (set V 0x116A) ?ㅘ (compose-vowel))
("oai" (set V 0x116B) ?ㅙ (compose-vowel))
("wae" (set V 0x116B) ?ㅙ (compose-vowel))
+ ("uae" (set V 0x116B) ?ㅙ (compose-vowel))
+ ("oae" (set V 0x116B) ?ㅙ (compose-vowel))
("oi" (set V 0x116C) ?ㅚ (compose-vowel))
+ ("woe" (set V 0x116C) ?ㅚ (compose-vowel))
+ ("uoe" (set V 0x116C) ?ㅚ (compose-vowel))
("oe" (set V 0x116C) ?ㅚ (compose-vowel))
("yo" (set V 0x116D) ?ㅛ (compose-vowel))
+ ("io" (set V 0x116D) ?ㅛ (compose-vowel))
("u" (set V 0x116E) ?ㅜ (compose-vowel))
+ ("w" (set V 0x116E) ?ㅜ (compose-vowel))
+ ("oo" (set V 0x116E) ?ㅜ (compose-vowel))
("ueo" (set V 0x116F) ?ㅝ (compose-vowel))
("wo" (set V 0x116F) ?ㅝ (compose-vowel))
+ ("uo" (set V 0x116F) ?ㅝ (compose-vowel))
("ue" (set V 0x1170) ?ㅞ (compose-vowel))
("we" (set V 0x1170) ?ㅞ (compose-vowel))
- ("ui" (set V 0x1171) ?ㅟ (compose-vowel))
("wi" (set V 0x1171) ?ㅟ (compose-vowel))
("yu" (set V 0x1172) ?ㅠ (compose-vowel))
+ ("iu" (set V 0x1172) ?ㅠ (compose-vowel))
("eu" (set V 0x1173) ?ㅡ (compose-vowel))
("eui" (set V 0x1174) ?ㅢ (compose-vowel))
("ui" (set V 0x1174) ?ㅢ (compose-vowel))
- ("i" (set V 0x1175) ?ㅣ (compose-vowel)))
+ ("i" (set V 0x1175) ?ㅣ (compose-vowel))
+ ("y" (set V 0x1175) ?ㅣ (compose-vowel))
+ ("ee" (set V 0x1175) ?ㅣ (compose-vowel)))
;; Keys starting V.
(V-head
("a") ("y") ("e") ("o") ("w") ("u") ("i"))
+ ;; Input fullwidth punction characters by typing a punction twice.
(punctuation
("," ?,)
(",," ?、)
("!!" ?!))
(backspace
- ((BackSpace) (undo)))
+ ((BackSpace) (> @@ 1 ((undo)) ((unhandle)))))
- (tilda
- ("~"))
+ ;; Toggle normal syllable mode and isolated jamo mode.
+ (toggle-mode
+ ("I" (= ISOLATED 0 ((set ISOLATED 1)) ((set ISOLATED 0)))))
- (space
+ (commit-preedit
+ (";")
((S-\ ))))
+(include (t nil cjk-util) map)
+
(state
(init
+ "로마자"
+ ;; This is to suppress compose action.
(t (set L 0))
+ ;; Uppercase keys are translated to the corresponding lowercase keys.
+ (uppercase)
(X (set L L1) (shift after-L))
(L (shift after-L))
(V (shift after-LV))
- (punctuation)
+ (T)
(backspace)
- (space)
- (tilda (shift single)))
+ (punctuation)
+ (enter-fullwidth-mode)
+ (enter-single-fullwidth-mode)
+ (toggle-mode (shift isolated-jamo-mode)))
(after-L
(V (shift after-LV))
- (space (shift init))
+ (commit-preedit (shift init))
(backspace))
(after-LV
(X (shift after-LVX))
(T (shift init))
- (space (shift init))
+ (commit-preedit (shift init))
(backspace))
(after-LVX
(V-head (delete @<) (pushback 0) (shift fix-LV-redo-L))
- (space (shift init))
- (backspace)
- (nil (delete @<) (pushback 0) (shift fix-LVT-redo-L)))
-
- (fix-LVT-redo-L
- (t (set L 0))
- (X (set L L1) (shift fix-LVT-redo-V))
- (L (shift fix-LVT-redo-V))
- (V (shift fix-LVT-redo-T)))
- (fix-LVT-redo-V
- (V (shift fix-LVT-redo-T)))
- (fix-LVT-redo-T
- (X (shift init)))
+ (commit-preedit (shift init))
+ (backspace))
(fix-LV-redo-L
(t (set L 0))
(X (set L L1) (shift fix-LV-redo-V))
(L (shift fix-LV-redo-V))
- (V (shift init)))
+ (V (set L 0x110B) (set T 0x11A7) (compose) (shift init)))
(fix-LV-redo-V
- (V (shift init)))
+ (V (set T 0x11A7) (compose) (shift init)))
- (single
+ (isolated-jamo-mode
+ "자모"
+ ;; Suppress both compose and compose-vowel action.
(t (set L -1))
- (X (shift init))
- (L (shift init))
- (T (shift init))
- (V (shift init))))
+ (X (commit))
+ (L (set L -1) (commit))
+ (T (commit))
+ (V (commit))
+ (commit-preedit (commit))
+ (enter-fullwidth-mode)
+ (enter-single-fullwidth-mode)
+ (toggle-mode (shift init))
+ (nil (unhandle))))
+
+(include (t nil cjk-util) state)
;; Local Variables:
;; coding: utf-8