From: handa Date: Tue, 23 Feb 2010 15:59:50 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: ALPHA~50 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e529974cf0d84169c75985667e7c690416a1e3c4;p=m17n%2Fm17n-lib-js.git *** empty log message *** --- diff --git a/el-kbd.mimx b/el-kbd.mimx new file mode 100644 index 0000000..fd011a6 --- /dev/null +++ b/el-kbd.mimx @@ -0,0 +1,647 @@ + + + + el + kbd + + Greek input method simulating the Greek keyboard. + 1! 2@ 3# 4$ 5% 6^ 7& 8* 9( 0) -_ =+ `~ + ;: ςΣ εΕ ρΡ τΤ υΥ θΘ ιΙ οΟ πΠ [{ ]} + αΑ σΣ δΔ φΦ γΓ ηΗ ξΞ κΚ λΛ ΄¨ '" \| + ζΖ χΧ ψΨ ωΩ βΒ νΝ μΜ ,< .> /? + + Ψ + + + + + q + + + 59 + + + + + w + + + 962 + + + + + e + + + 949 + + + + + r + + + 961 + + + + + t + + + 964 + + + + + y + + + 965 + + + + + u + + + 952 + + + + + i + + + 953 + + + + + o + + + 959 + + + + + p + + + 960 + + + + + [ + + + 91 + + + + + ] + + + 93 + + + + + a + + + 945 + + + + + s + + + 963 + + + + + d + + + 948 + + + + + f + + + 966 + + + + + g + + + 947 + + + + + h + + + 951 + + + + + j + + + 958 + + + + + k + + + 954 + + + + + l + + + 955 + + + + + ; + + + 900 + + + + + z + + + 950 + + + + + x + + + 967 + + + + + c + + + 968 + + + + + v + + + 969 + + + + + b + + + 946 + + + + + n + + + 957 + + + + + m + + + 956 + + + + + Q + + + 58 + + + + + W + + + 931 + + + + + E + + + 917 + + + + + R + + + 929 + + + + + T + + + 932 + + + + + Y + + + 933 + + + + + U + + + 920 + + + + + I + + + 921 + + + + + O + + + 927 + + + + + P + + + 928 + + + + + A + + + 913 + + + + + S + + + 931 + + + + + D + + + 916 + + + + + F + + + 934 + + + + + G + + + 915 + + + + + H + + + 919 + + + + + J + + + 926 + + + + + K + + + 922 + + + + + L + + + 923 + + + + + : + + + 168 + + + + + Z + + + 918 + + + + + X + + + 935 + + + + + C + + + 936 + + + + + V + + + 937 + + + + + B + + + 914 + + + + + N + + + 925 + + + + + M + + + 924 + + + + + ;a + + + 940 + + + + + ;e + + + 941 + + + + + ;h + + + 942 + + + + + ;i + + + 943 + + + + + ;o + + + 972 + + + + + ;y + + + 973 + + + + + ;v + + + 974 + + + + + ;A + + + 902 + + + + + ;E + + + 904 + + + + + ;H + + + 905 + + + + + ;I + + + 906 + + + + + ;O + + + 908 + + + + + ;Y + + + 910 + + + + + ;V + + + 911 + + + + + :i + + + 970 + + + + + :y + + + 971 + + + + + :I + + + 938 + + + + + :Y + + + 939 + + + + + ;:i + + + 912 + + + + + :;i + + + 912 + + + + + ;:y + + + 944 + + + + + :;y + + + 944 + + + + + + + + + + \ No newline at end of file diff --git a/vi-base.mimx b/vi-base.mimx new file mode 100644 index 0000000..0ba8ec2 --- /dev/null +++ b/vi-base.mimx @@ -0,0 +1,1345 @@ + + + + t + nil + vi-base + + Provide bases for Vietnamese input methods. +This is acutually not a standalone input method, but is expected +to be included in the other Vietnamese input method (e.g. vi-telex, vi-vni). + + + + + T + + + + M + + + + + + + + + + 234 + + + + 417 + + + + 202 + + + + 416 + + + + 3 + + + + 1 + + @- + + + 2 + + + + + + + + + + + + 127 + + + + + + 103 + + + + 71 + + + + + + 105 + + + + 73 + + + + + + + + 113 + + + + 81 + + + + + + 117 + + + + 85 + + + + + + + + + 0 + + + + + + + + 111 + + + + 79 + + + + + + 97 + + + + 65 + + + + 101 + + + + 69 + + + + 111 + + + + 79 + + + + + + + + 117 + + + + 85 + + + + + + 121 + + + + 89 + + + + + + + + 2 + + + + 1 + + @- + + + 1 + + + + + + 1 + + 1 + + + + + + T + + + @> + + + + + + + + a + + + aáàảãạ + + + + + A + + + AÁÀẢÃẠ + + + + + e + + + eéèẻẽẹ + + + + + E + + + EÉÈẺẼẸ + + + + + i + + + iíìỉĩị + + + + + I + + + IÍÌỈĨỊ + + + + + o + + + oóòỏõọ + + + + + O + + + OÓÒỎÕỌ + + + + + u + + + uúùủũụ + + + + + U + + + UÚÙỦŨỤ + + + + + y + + + yýỳỷỹỵ + + + + + Y + + + YÝỲỶỸỴ + + + + + + + b + + + 98 + + + + + c + + + 99 + + + + + d + + + 100 + + + + + g + + + 103 + + + + + h + + + 104 + + + + + k + + + 107 + + + + + l + + + 108 + + + + + m + + + 109 + + + + + n + + + 110 + + + + + p + + + 112 + + + + + q + + + 113 + + + + + t + + + 116 + + + + + v + + + 118 + + + + + B + + + 66 + + + + + C + + + 67 + + + + + D + + + 68 + + + + + G + + + 71 + + + + + H + + + 72 + + + + + K + + + 75 + + + + + L + + + 76 + + + + + M + + + 77 + + + + + N + + + 78 + + + + + P + + + 80 + + + + + Q + + + 81 + + + + + T + + + 84 + + + + + V + + + 86 + + + + + + + q + + + 113 + + + + + Q + + + 81 + + + + + d + + + 100 + + + + + D + + + 68 + + + + + g + + + 103 + + + + + G + + + 71 + + + + + h + + + 104 + + + + + H + + + 72 + + + + + k + + + 107 + + + + + K + + + 75 + + + + + l + + + 108 + + + + + L + + + 76 + + + + + v + + + 118 + + + + + V + + + 86 + + + + + b + + + 98 + + + + + B + + + 66 + + + + + z + + + 122 + + + + + Z + + + 90 + + + + + + + c + + + 99 + + + + + m + + + 109 + + + + + n + + + 110 + + + + + p + + + 112 + + + + + t + + + 116 + + + + + C + + + 67 + + + + + M + + + 77 + + + + + N + + + 78 + + + + + P + + + 80 + + + + + T + + + 84 + + + + + + + g + + + 103 + + + + + h + + + 104 + + + + + G + + + 71 + + + + + H + + + 72 + + + + + + + a + + + 97 + + + + + b + + + 98 + + + + + c + + + 99 + + + + + d + + + 100 + + + + + e + + + 101 + + + + + f + + + 102 + + + + + g + + + 103 + + + + + h + + + 104 + + + + + i + + + 105 + + + + + j + + + 106 + + + + + k + + + 107 + + + + + l + + + 108 + + + + + m + + + 109 + + + + + n + + + 110 + + + + + o + + + 111 + + + + + p + + + 112 + + + + + q + + + 113 + + + + + r + + + 114 + + + + + s + + + 115 + + + + + t + + + 116 + + + + + u + + + 117 + + + + + v + + + 118 + + + + + w + + + 119 + + + + + x + + + 120 + + + + + y + + + 121 + + + + + z + + + 122 + + + + + A + + + 65 + + + + + B + + + 66 + + + + + C + + + 67 + + + + + D + + + 68 + + + + + E + + + 69 + + + + + F + + + 70 + + + + + G + + + 71 + + + + + H + + + 72 + + + + + I + + + 73 + + + + + J + + + 74 + + + + + K + + + 75 + + + + + L + + + 76 + + + + + M + + + 77 + + + + + N + + + 78 + + + + + O + + + 79 + + + + + P + + + 80 + + + + + Q + + + 81 + + + + + R + + + 82 + + + + + S + + + 83 + + + + + T + + + 84 + + + + + U + + + 85 + + + + + V + + + 86 + + + + + W + + + 87 + + + + + X + + + 88 + + + + + Y + + + 89 + + + + + Z + + + 90 + + + + + 0 + + + 48 + + + + + 1 + + + 49 + + + + + 2 + + + 50 + + + + + 3 + + + 51 + + + + + 4 + + + 52 + + + + + 5 + + + 53 + + + + + 6 + + + 54 + + + + + 7 + + + 55 + + + + + 8 + + + 56 + + + + + 9 + + + 57 + + + + + + + ' + + + 39 + + + + + '' + + + ‘’ + + + + + " + + + 34 + + + + + "" + + + “” + + + + + + + \ + + + + + + + + BackSpace + + + + + + + + + + + + \ No newline at end of file diff --git a/vi-tcvn.mimx b/vi-tcvn.mimx new file mode 100644 index 0000000..69026ff --- /dev/null +++ b/vi-tcvn.mimx @@ -0,0 +1,1039 @@ + + + + vi + tcvn + + + Vietnames input method using the TCVN6064 sequence. +Typing Backslash ('\') toggles the normal mode and English mode. +The following variables are customizable: + tone-mark-on-last: control tone mark position in equivocal cases + backspace-is-undo: control the action of Backspace key (delete or undo) + + Ắ(TCVN) + + + + Flag to control tone mark position in equivocal cases. +If this variable is 0 (the default), put tone mark on the first vowel +in such equivocal cases as "oa", "oe", "uy". +Otherwise, put tone mark on the last vowel. + + 0 + + 0 + 1 + + + + + Flag to control the action of Backspace key (delete or undo). +If this variable is 0 (the default), Backspace key deletes the previous +character (e.g. "q u a i s BS" => "quá"). +If the value is 1, Backspace key undoes the previous key +(e.g. "q u a i s BS" => "quai"). + + 0 + + 0 + 1 + + + + + + + t + nil + vi-base + +
macro
+
+
+ + + + t + nil + vi-base + +
map
+
+ + + + 2 + + + âấầẩẫậ + + + + + @ + + + ÂẤẦẨẪẬ + + + + + 1 + + + ăắằẳẵặ + + + + + ! + + + ĂẮẰẲẴẶ + + + + + 3 + + + êếềểễệ + + + + + # + + + ÊẾỀỂỄỆ + + + + + 4 + + + ôốồổỗộ + + + + + $ + + + ÔỐỒỔỖỘ + + + + + ] + + + ơớờởỡợ + + + + + } + + + ƠỚỜỞỠỢ + + + + + [ + + + ưứừửữự + + + + + { + + + ƯỨỪỬỮỰ + + + + + + + 0 + + + 273 + + + + + ) + + + 272 + + + + + + + 8 + + + 1 + + + 49 + + + + + 5 + + + 2 + + + 50 + + + + + 6 + + + 3 + + + 51 + + + + + 7 + + + 4 + + + 52 + + + + + 9 + + + 5 + + + 53 + + + + + + + = + + + 8363 + + + + + == + + + 61 + + + + + + A-1 + + + + 49 + + + + + + A-2 + + + + 50 + + + + + + A-3 + + + + 51 + + + + + + A-4 + + + + 52 + + + + + + A-5 + + + + 53 + + + + + + A-6 + + + + 54 + + + + + + A-7 + + + + 55 + + + + + + A-8 + + + + 56 + + + + + + A-9 + + + + 57 + + + + + + A-0 + + + + 48 + + + + + + A-- + + + + 45 + + + + + + A-= + + + + 61 + + + + + + A-\ + + + + 92 + + + + + + A-[ + + + + 91 + + + + + + A-] + + + + 93 + + + + + + A-! + + + + 33 + + + + + + A-@ + + + + 64 + + + + + + A-# + + + + 35 + + + + + + A-$ + + + + 36 + + + + + + A-% + + + + 37 + + + + + + A-^ + + + + 94 + + + + + + A-& + + + + 38 + + + + + + A-* + + + + 42 + + + + + + A-( + + + + 40 + + + + + + A-) + + + + 41 + + + + + + A-_ + + + + 95 + + + + + + A-+ + + + + 43 + + + + + + A-| + + + + 124 + + + + + + A-{ + + + + 123 + + + + + + A-} + + + + 125 + + + + + + + 22 + + + 2 + + + + + @@ + + + @ + + + + + 11 + + + 1 + + + + + !! + + + ! + + + + + 33 + + + 3 + + + + + ## + + + ## + + + + + 44 + + + 4 + + + + + $$ + + + $ + + + + + ]] + + + ] + + + + + }} + + + } + + + + + [[ + + + [ + + + + + {{ + + + { + + + + + 00 + + + 0 + + + + + )) + + + ) + + + +
+ + + + + + @-1 + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + @-1 + + + + + + + @-1 + + + + + + M + + + + + + + @-1 + + + + state-after-v + + + + + M + + + + + + + @-1 + + + + state-after-v + + + + + state-temporary-escape + + + + + state-escape-in-normal-mode + + + + + + + + + state-after-vc + + + + + state-after-vc + + + + + M + + + + + + + + + + @-1 + + + + T + + + + + M + + + + + M + + + + + + + + + + @-1 + + + + T + + + + + M + + + + + @- + + + 1 + + + state-after-t + + + + + @- + + + + + + + + + + + + 0 + + + + + + 2 + + + 0 + + + + + + + + + + + 0 + + + + + + 1 + + + 0 + + + + + + 1 + + state-init + + + + + + + + + 1 + + + + + 1 + + + + + 1 + + + + + @- + + + 1 + + + state-after-t + + + + + @- + + + 1 + + + + + + 0 + + + state-after-v + + + + + + + + + -1 + + + + + + + + + + + T + + + + @> + + + state-temporary-escape + + + + 1 + + @- + + + + + + + + + + + + + + state-after-vc + + + + 1 + + state-after-v + + + + + + + en + + + + + + + + + EN + + + \ + + + state-init + + + + + state-permanent-escape + + + + + EN + + + 1 + + + + + state-escape-in-permanent-escape + + + + + + + + Ắ + + + \ + + + + state-permanent-escape + + + + +
\ No newline at end of file diff --git a/vi-telex.mimx b/vi-telex.mimx new file mode 100644 index 0000000..1953ce1 --- /dev/null +++ b/vi-telex.mimx @@ -0,0 +1,1351 @@ + + + + vi + telex + + + Vietnames input method using the TELEX key sequence. +Typing Backslash ('\') toggles the normal mode and English mode. +The following variables are customizable: + tone-mark-on-last: control tone mark position in equivocal cases + backspace-is-undo: control the action of Backspace key (delete or undo) + + Ắ(TLX) + + + + Flag to control tone mark position in equivocal cases. +If this variable is 0 (the default), put tone mark on the first vowel +in such equivocal cases as "oa", "oe", "uy". +Otherwise, put tone mark on the last vowel. + + 0 + + 0 + 1 + + + + + Flag to control the action of Backspace key (delete or undo). +If this variable is 0 (the default), Backspace key deletes the previous +character (e.g. "q u a i s BS" => "quá"). +If the value is 1, Backspace key undoes the previous key +(e.g. "q u a i s BS" => "quai"). + + 0 + + 0 + 1 + + + + + + + t + nil + vi-base + +
macro
+
+
+ + + + t + nil + vi-base + +
map
+
+ + + + aa + + + âấầẩẫậ + + + + + AA + + + ÂẤẦẨẪẬ + + + + + Aa + + + ÂẤẦẨẪẬ + + + + + aw + + + ăắằẳẵặ + + + + + AW + + + ĂẮẰẲẴẶ + + + + + Aw + + + ĂẮẰẲẴẶ + + + + + ee + + + êếềểễệ + + + + + EE + + + ÊẾỀỂỄỆ + + + + + Ee + + + ÊẾỀỂỄỆ + + + + + oo + + + ôốồổỗộ + + + + + OO + + + ÔỐỒỔỖỘ + + + + + Oo + + + ÔỐỒỔỖỘ + + + + + ow + + + ơớờởỡợ + + + + + OW + + + ƠỚỜỞỠỢ + + + + + Ow + + + ƠỚỜỞỠỢ + + + + + uw + + + ưứừửữự + + + + + UW + + + ƯỨỪỬỮỰ + + + + + Uw + + + ƯỨỪỬỮỰ + + + + + w + + + + + + 0 + + + ưứừửữự + + + + 1 + + w + + + + + + + W + + + + + + 0 + + + ƯỨỪỬỮỰ + + + + 1 + + W + + + + + + + ooo + + + oóòỏõọ + + + oóòỏõọ + + + + + + 111 + + + + + OOO + + + OÓÒỎÕỌ + + + OÓÒỎÕỌ + + + + + + 79 + + + + + Ooo + + + OÓÒỎÕỌ + + + oóòỏõọ + + + + + + 79 + + + + + + + dd + + + 273 + + + + + DD + + + 272 + + + + + Dd + + + 272 + + + + + + + z + + + 0 + + + 122 + + + + + Z + + + 0 + + + 90 + + + + + s + + + 1 + + + 115 + + + + + S + + + 1 + + + 83 + + + + + f + + + 2 + + + 102 + + + + + F + + + 2 + + + 70 + + + + + r + + + 3 + + + 114 + + + + + R + + + 3 + + + 82 + + + + + x + + + 4 + + + 120 + + + + + X + + + 4 + + + 88 + + + + + j + + + 5 + + + 106 + + + + + J + + + 5 + + + 74 + + + + + + + z + + + 122 + + + + + s + + + 115 + + + + + f + + + 102 + + + + + r + + + 114 + + + + + x + + + 120 + + + + + j + + + 106 + + + + + Z + + + 90 + + + + + S + + + 83 + + + + + F + + + 70 + + + + + R + + + 82 + + + + + X + + + 88 + + + + + J + + + 74 + + + + + + + aaa + + + aa + + + + + AAA + + + AA + + + + + Aaa + + + Aa + + + + + eee + + + ee + + + + + EEE + + + EE + + + + + Eee + + + Ee + + + + + ddd + + + dd + + + + + DDD + + + DD + + + + + Ddd + + + Dd + + + + + aww + + + aw + + + + + AWW + + + AW + + + + + Aww + + + Aw + + + + + uww + + + uw + + + + + UWW + + + UW + + + + + Uww + + + Uw + + + + + oww + + + ow + + + + + OWW + + + OW + + + + + Oww + + + Ow + + + + + ww + + + 119 + + + + + WW + + + 87 + + + + + Ww + + + 87 + + + + + zz + + + 122 + + + + + ZZ + + + 90 + + + + + Zz + + + 90 + + + + + ss + + + 115 + + + + + SS + + + 83 + + + + + Ss + + + 83 + + + + + ff + + + 102 + + + + + FF + + + 70 + + + + + Ff + + + 70 + + + + + rr + + + 114 + + + + + RR + + + 82 + + + + + Rr + + + 82 + + + + + xx + + + 120 + + + + + XX + + + 88 + + + + + Xx + + + 88 + + + + + jj + + + 106 + + + + + JJ + + + 74 + + + + + Jj + + + 74 + + + +
+ + + + + + @-1 + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + @-1 + + + + + + + @-1 + + + + + + + + + + @-1 + + 102 + + + + @-1 + + 106 + + + + @-1 + + 122 + + + + @-1 + + 70 + + + + @-1 + + 74 + + + + @-1 + + 90 + + + + state-temporary-escape + + + + 1 + + + @-1 + + + + + + + + M + + + + + + + @-1 + + + + state-after-v + + + + + M + + + + + + + @-1 + + + + state-after-v + + + + + state-temporary-escape + + + + + state-escape-in-normal-mode + + + + + + + + + state-after-vc + + + + + M + + + + + + + + + + @-1 + + + + T + + + + + M + + + + + M + + + + + + + + + + @-1 + + + + T + + + + + M + + + + + state-temporary-escape + + + + + @- + + + 1 + + + state-after-t + + + + + @- + + + + + + + + + + + + 0 + + + + + + 2 + + + 0 + + + + + + + + + + + + 0 + + + + + + 1 + + + 0 + + + + + + + 1 + + state-init + + + + + + + + + 1 + + + + + + + + + @-2 + + 110 + + + + @-2 + + 99 + + + + @-2 + + 78 + + + + @-2 + + 67 + + + + 1 + + + + 1 + + state-temporary-escape + + + + + + + state-temporary-escape + + + + + @- + + + 1 + + + state-after-t + + + + + state-temporary-escape + + + + + state-temporary-escape + + + + + @- + + + 1 + + + + + + + 0 + + + state-after-v + + + + + + + + + -1 + + + + + + + + + + + T + + + + @> + + + state-temporary-escape + + + + 1 + + @- + + + + + + + + + + + + + + state-after-vc + + + + 1 + + state-after-v + + + + + + + en + + + + + + + + + EN + + + \ + + + state-init + + + + + state-permanent-escape + + + + + EN + + + 1 + + + + + state-escape-in-permanent-escape + + + + + + + + Ắ + + + \ + + + + state-permanent-escape + + + + +
\ No newline at end of file diff --git a/vi-viqr.mimx b/vi-viqr.mimx new file mode 100644 index 0000000..e6f5a29 --- /dev/null +++ b/vi-viqr.mimx @@ -0,0 +1,722 @@ + + + + vi + viqr + + + Vietnames input method using the VIQR key sequence. +Typing Backslash ('\') toggles the normal mode and English mode. +The following variables are customizable: + tone-mark-on-last: control tone mark position in equivocal cases + backspace-is-undo: control the action of Backspace key (delete or undo) + + Ắ(VIQR) + + + + Flag to control tone mark position in equivocal cases. +If this variable is 0 (the default), put tone mark on the first vowel +in such equivocal cases as "oa", "oe", "uy". +Otherwise, put tone mark on the last vowel. + + 0 + + 0 + 1 + + + + + Flag to control the action of Backspace key (delete or undo). +If this variable is 0 (the default), Backspace key deletes the previous +character (e.g. "q u a i s BS" => "quá"). +If the value is 1, Backspace key undoes the previous key +(e.g. "q u a i s BS" => "quai"). + + 0 + + 0 + 1 + + + + + + + t + nil + vi-base + +
macro
+
+
+ + + + t + nil + vi-base + +
map
+
+ + + + a^ + + + âấầẩẫậ + + + + + A^ + + + ÂẤẦẨẪẬ + + + + + a( + + + ăắằẳẵặ + + + + + A( + + + ĂẮẰẲẴẶ + + + + + e^ + + + êếềểễệ + + + + + E^ + + + ÊẾỀỂỄỆ + + + + + o^ + + + ôốồổỗộ + + + + + O^ + + + ÔỐỒỔỖỘ + + + + + o+ + + + ơớờởỡợ + + + + + O+ + + + ƠỚỜỞỠỢ + + + + + u+ + + + ưứừửữự + + + + + U+ + + + ƯỨỪỬỮỰ + + + + + + + dd + + + 273 + + + + + DD + + + 272 + + + + + Dd + + + 272 + + + + + + + 0 + + + 0 + + + 48 + + + + + ' + + + 1 + + + 39 + + + + + ` + + + 2 + + + 96 + + + + + ? + + + 3 + + + 63 + + + + + ~ + + + 4 + + + 126 + + + + + . + + + 5 + + + 46 + + + + + + + a^^ + + + a^ + + + + + A^^ + + + A^ + + + + + a(( + + + a( + + + + + A(( + + + A( + + + + + e^^ + + + e^ + + + + + E^^ + + + E^ + + + + + o^^ + + + o^ + + + + + O^^ + + + O^ + + + + + o++ + + + o+ + + + + + O++ + + + O+ + + + + + u++ + + + u+ + + + + + U++ + + + U+ + + + +
+ + + + + + @-1 + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + @-1 + + + + + + + @-1 + + + + + + M + + + + + + + @-1 + + + + state-after-v + + + + + M + + + + + + + @-1 + + + + state-after-v + + + + + state-temporary-escape + + + + + state-escape-in-normal-mode + + + + + + + state-after-vc + + + + + state-after-vc + + + + + M + + + + + + + + + + @-1 + + + + T + + + + + M + + + + + M + + + + + + + + + + @-1 + + + + T + + + + + M + + + + + @- + + + 1 + + + state-after-t + + + + + @- + + + + + + + + + + + + 0 + + + + + + 2 + + + 0 + + + + + + + + + + + 0 + + + + + + 1 + + + 0 + + + + + + 1 + + state-init + + + + + + + + + 1 + + + + + 1 + + + + + 1 + + + + + @- + + + 1 + + + state-after-t + + + + + @- + + + 1 + + + + + + 0 + + + state-after-v + + + + + + + + + -1 + + + + + + + + + + + T + + + + @> + + + state-temporary-escape + + + + 1 + + @- + + + + + + + + + + + + + + state-after-vc + + + + 1 + + state-after-v + + + + + + + en + + + + + + + + + EN + + + \ + + + state-init + + + + + state-permanent-escape + + + + + EN + + + 1 + + + + + state-escape-in-permanent-escape + + + + + + + + Ắ + + + \ + + + + state-permanent-escape + + + + +
\ No newline at end of file diff --git a/vi-vni.mimx b/vi-vni.mimx new file mode 100644 index 0000000..96a74cf --- /dev/null +++ b/vi-vni.mimx @@ -0,0 +1,715 @@ + + + + vi + vni + + + Vietnames input method using the VNI key sequence. +Typing Backslash ('\') toggles the normal mode and English mode. +The following variables are customizable: + tone-mark-on-last: control tone mark position in equivocal cases + backspace-is-undo: control the action of Backspace key (delete or undo) + + Ắ(VNI) + + + + Flag to control tone mark position in equivocal cases. +If this variable is 0 (the default), put tone mark on the first vowel +in such equivocal cases as "oa", "oe", "uy". +Otherwise, put tone mark on the last vowel. + + 0 + + 0 + 1 + + + + + Flag to control the action of Backspace key (delete or undo). +If this variable is 0 (the default), Backspace key deletes the previous +character (e.g. "q u a i s BS" => "quá"). +If the value is 1, Backspace key undoes the previous key +(e.g. "q u a i s BS" => "quai"). + + 0 + + 0 + 1 + + + + + + + t + nil + vi-base + +
macro
+
+
+ + + + t + nil + vi-base + +
map
+
+ + + + a6 + + + âấầẩẫậ + + + + + A6 + + + ÂẤẦẨẪẬ + + + + + a8 + + + ăắằẳẵặ + + + + + A8 + + + ĂẮẰẲẴẶ + + + + + e6 + + + êếềểễệ + + + + + E6 + + + ÊẾỀỂỄỆ + + + + + o6 + + + ôốồổỗộ + + + + + O6 + + + ÔỐỒỔỖỘ + + + + + o7 + + + ơớờởỡợ + + + + + O7 + + + ƠỚỜỞỠỢ + + + + + u7 + + + ưứừửữự + + + + + U7 + + + ƯỨỪỬỮỰ + + + + + + + d9 + + + 273 + + + + + D9 + + + 272 + + + + + + + 0 + + + 0 + + + 48 + + + + + 1 + + + 1 + + + 49 + + + + + 2 + + + 2 + + + 50 + + + + + 3 + + + 3 + + + 51 + + + + + 4 + + + 4 + + + 52 + + + + + 5 + + + 5 + + + 53 + + + + + + + a66 + + + a6 + + + + + A66 + + + A6 + + + + + a88 + + + a8 + + + + + A88 + + + A8 + + + + + e66 + + + e6 + + + + + E66 + + + E6 + + + + + o66 + + + o6 + + + + + O66 + + + O6 + + + + + o77 + + + o7 + + + + + O77 + + + O7 + + + + + u77 + + + u7 + + + + + U77 + + + U7 + + + +
+ + + + + + @-1 + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + @-1 + + + + + + + @-1 + + + + + + M + + + + + + + @-1 + + + + state-after-v + + + + + M + + + + + + + @-1 + + + + state-after-v + + + + + state-temporary-escape + + + + + state-escape-in-normal-mode + + + + + + + + state-after-vc + + + + + state-after-vc + + + + + M + + + + + + + + + + @-1 + + + + T + + + + + M + + + + + M + + + + + + + + + + @-1 + + + + T + + + + + M + + + + + @- + + + 1 + + + state-after-t + + + + + @- + + + + + + + + + + + + 0 + + + + + + 2 + + + 0 + + + + + + + + + + + 0 + + + + + + 1 + + + 0 + + + + + + 1 + + state-init + + + + + + + + + 1 + + + + + 1 + + + + + 1 + + + + + @- + + + 1 + + + state-after-t + + + + + @- + + + 1 + + + + + + 0 + + + state-after-v + + + + + + + + + -1 + + + + + + + + + + + T + + + + @> + + + state-temporary-escape + + + + 1 + + @- + + + + + + + + + + + + + + state-after-vc + + + + 1 + + state-after-v + + + + + + + en + + + + + + + + + EN + + + \ + + + state-init + + + + + state-permanent-escape + + + + + EN + + + 1 + + + + + state-escape-in-permanent-escape + + + + + + + + Ắ + + + \ + + + + state-permanent-escape + + + + +
\ No newline at end of file diff --git a/xex.html b/xex.html index 618db49..20a7605 100644 --- a/xex.html +++ b/xex.html @@ -19,9 +19,9 @@
text
debug Info
- - - + + +
keykeycodestatuskeyseqpreedit
down0
press0
keykeycodestatuskeymappreedit
down0
press0
diff --git a/xex.js b/xex.js index 8be7f9d..c76fce3 100644 --- a/xex.js +++ b/xex.js @@ -393,7 +393,7 @@ Xex.Domain.prototype = { var func = this.functions[name]; if (! func) throw new Xex.ErrTerm (Xex.Error.UnknownFunction, - "Unknown function: " + this + ':' + name); + "Unknown function: " + name); return func; }, CopyFunc: function (domain, name) @@ -483,10 +483,12 @@ Xex.ParseTermList = function (domain, node) if (n.nodeName == 'defun' || n.nodeName == 'defmacro') Xex.parse_defun_head (domain, n); } - var terms = new Array (); + var terms = false; for (var n = node; n; n = n.nextSibling) if (n.nodeType == 1) { + if (! terms) + terms = new Array (); if (n.nodeName == 'defun' || n.nodeName == 'defmacro') Xex.parse_defun_body (domain, n); else if (n.nodeName == 'defvar') @@ -795,7 +797,7 @@ Xex.LstTerm = function (list) { this.val = list; }; return result; if (result.IsTrue) return args[1].Eval (domain); - if (args.Length == 2) + if (args.length == 2) return Zero; return args[2].Eval (domain); } @@ -1299,6 +1301,7 @@ MIM.Action.prototype.Run = function (domain) MIM.Keymap = function () { + this.name = 'TOP'; this.submaps = null; this.actions = null; }; @@ -1309,12 +1312,14 @@ MIM.Keymap = function () { var keyseq = rule.keyseq; var len = keyseq.val.length; + var name = ''; for (var i = 0; i < len; i++) { var key = keyseq.val[i]; var sub = false; + name += key.key; if (! keymap.submaps) keymap.submaps = {}; else @@ -1322,6 +1327,7 @@ MIM.Keymap = function () if (! sub) keymap.submaps[key.key] = sub = new MIM.Keymap (); keymap = sub; + keymap.name = name; } keymap.actions = rule.actions; } @@ -1405,7 +1411,22 @@ MIM.im_domain.DefType (MIM.State.prototype); function Finsert (domain, vari, args) { - domain.context.insert (args[0].val, null); + var text; + if (args[0].type == 'integer') + text = String.fromCharCode (args[0].val); + else + text = args[0].val; + domain.context.insert (text, null); + } + + function Finsert_candidates (domain, vari, args) + { + var ic = domain.context; + var candidates = new Candidates (args, column); + var candidate = candidates.Current (); + + if ( + } im_domain.DefSubr (Finsert, "insert", false, 1, 1); @@ -1551,6 +1572,232 @@ MIM.im_domain.DefType (MIM.State.prototype); this.table.length = 0; } + function Block (index, term) + { + this.Index = index; + if (term.IsStr) + this.Data = term.val; + else if (term.IsList) + { + this.Data = new Array (); + for (var i = 0; i < term.val.length; i++) + this.Data.push (term.val[i].val); + } + } + + Block.prototype.Count = function () { return this.Data.length; } + Block.prototype.get = function (i) + { + return (this.Data instanceof Array ? this.Data[i] : this.Data.charAt (i)); + } + + function fill_group (start) + { + var nitems = this.group.length; + var r = this.row; + var b = this.blocks[r]; + + if (start < b.Index) + while (start < b.Index) + b = this.blocks[--r]; + else + while (start >= b.Index + b.Count ()) + b = this.blocks[++r]; + this.row = r; + + var count = b.Count (); + start -= b.Index; + for (var i = 0; i < nitems; i++, start++) + { + if (start >= count) + { + r++; + if (r == this.blocks.Length) + return i; + b = this.blocks[r]; + count = b.Count (); + start = 0; + } + this.group[i] = b.get (start); + } + return nitems; + } + + function Candidates (candidates, column) + { + this.column = column; + this.row = 0; + this.index = 0; + this.total = 0; + this.blocks = new Array (); + + for (var i = 0; i < candidates.length; i++) + { + var block = new Block (this.total, candidates[i]); + this.blocks.push (block); + this.total += block.Count (); + } + } + + Candidates.prototype.Column = function () + { + return (this.column > 0 ? this.index % this.column + : this.index - this.blocks[this.row].Index); + } + + Candidates.prototype.GroupLength = function () + { + if (this.column > 0) + { + var nitems = this.group.length; + var start = this.index - (this.index % nitems); + return (start + this.column <= this.total ? this.column + : this.total - start); + } + return this.blocks[this.row].Count; + } + + Candidates.prototype.Current = function () + { + var b = this.blocks[this.row]; + return b.get (this.index - b.Index); + } + + Candidates.prototype.PrevGroup () + { + var col = this.Column (); + var nitems; + if (this.column > 0) + { + this.index -= this.column; + if (this.index >= 0) + nitems = this.column; + else + { + var lastcol = (this.total - 1) % this.column; + this.index = (col < lastcol ? this.total - lastcol + col + : this.total - 1); + this.row = this.blocks.length - 1; + nitems = lastcol + 1; + } + while (this.blocks[this.row].Index > this.index) + this.row--; + } + else + { + this.row = this.row > 0 ? this.row - 1 : this.blocks.length - 1; + nitems = this.blocks[this.row].Count; + this.index = (this.blocks[this.row].Index + + (col < nitems ? col : nitems - 1)); + } + return nitems; + } + + Candidates.prototype.NextGroup = function () + { + var col = this.Column (); + var nitems; + if (this.column > 0) + { + this.index += this.column - col; + if (this.index < this.total) + { + if (this.index + col >= this.total) + { + nitems = this.total - this.index; + this.index = this.total - 1; + } + else + { + nitems = this.column; + this.index += col; + } + } + else + { + this.index = col; + this.row = 0; + } + while (this.blocks[this.row].Index > this.index) + this.row++; + } + else + { + this.row = this.row < this.blocks.length - 1 ? this.row + 1 : 0; + nitems = this.blocks[this.row].Count; + this.index = (this.blocks[this.row].Index + + (col < nitems ? col : nitems - 1)); + } + return nitems; + } + + Candidates.prototype.Prev = function () + { + var col = this.Column (); + + if (col == 0) + { + int nitems = this.PrevGroup (); + this.index += col < nitems - 1 ? col : nitems - 1; + } + else + this.index--; + } + + Candidates.prototype.Next = function () + { + int col = this.Column (); + int nitems = this.GroupLength (); + + if (col == nitems - 1) + { + nitems = this.NextGroup (); + this.index -= this.Column (); + } + else + this.index++; + } + + Candidates.prototype.First = function () { this.index -= this.Column (); } + + Candidates.prototype.Last = function () + { + this.index += this.GroupLength () - (this.Column + 1); + } + + Candidates.prototype.Select = funciton (selector) + { + if (selector instanceof MIM.Selector) + { + switch (selector.val) + { + case '@<': this.First (); break; + case '@>': this.Last (); break; + case '@-': this.Prev (); break; + case '@+': this.Next (); break; + case '@[': this.PrevGroup (); break; + case '@]': this.NextGroup (); break; + default: break; + } + return this.Current (); + } + var maxcol = this.GroupLength () - 1; + if (selector > maxcol) + selector = maxcol; + this.index = this.index - this.Column () + selector; + return this.Current (); + } + + function detach_candidates (ic) + { + ic.candidate_table.clear (); + ic.candidates = null; + ic.changed |= (MIM.ChangedStatus.Preedit | MIM.ChangedStatus.CursorPos + | ChangedStatus.CandidateList + | ChangedStatus.CandidateIndex + | ChangedStatus.CandidateShow); + } + function set_cursor (prefix, pos) { this.cursor_pos = pos; @@ -1582,7 +1829,7 @@ MIM.im_domain.DefType (MIM.State.prototype); var branch_actions = this.state.keymap.actions; MIM.log ('handling ' + this.keys.val[this.key_head] - + ' in ' + this.state.name); + + ' in ' + this.state.name + ':' + this.keymap.name); this.key_head = out.index; if (sub != this.keymap) { @@ -1590,20 +1837,22 @@ MIM.im_domain.DefType (MIM.State.prototype); restore_state.call (this); this.keymap = sub; MIM.log ('submap found'); - if (this.keymap.actions != null) + if (this.keymap.actions) { MIM.log ('taking map actions:'); if (! this.take_actions (this.keymap.actions)) return false; } - else if (this.keymap.submaps != null) + else if (this.keymap.submaps) { - MIM.log ('no map actions, inserting key:'); + MIM.log ('no map actions'); for (var i = this.state_key_head; i < this.key_head; i++) - this.preedit_replace (this.cursor_pos, this.cursor_pos, - this.keys.val[i].key, null); + { + MIM.log ('inserting key:' + this.keys.val[i].key); + this.insert (this.keys.val[i].key, null); + } } - if (this.keymap.submaps == null) + if (! this.keymap.submaps) { MIM.log ('terminal:'); if (this.keymap.branch_actions != null) @@ -1618,23 +1867,29 @@ MIM.im_domain.DefType (MIM.State.prototype); } else { - MIM.log ("no submap"); + MIM.log ('no submap'); var current_state = this.state; + var map = this.keymap; if (branch_actions) { - MIM.log ("branch actions"); + MIM.log ('branch actions'); if (! this.take_actions (this.keymap.branch_actions)) return false; } - if (this.state == current_state) + + if (map == this.keymap) { - if (this.state == this.initial_state + MIM.log ('no state change'); + if (map == this.initial_state.keymap && this.key_head < this.keys.val.length) - return false; - if (this.keymap != this.state.keymap) - this.shift (this.state); - else if (this.keymap.branch_actions == null) + { + MIM.log ('unhandled'); + return false; + } + if (this.keymap != current_state.keymap) + this.shift (current_state); + else if (this.keymap.actions == null) this.shift (this.initial_state); } } @@ -1642,10 +1897,11 @@ MIM.im_domain.DefType (MIM.State.prototype); } proto = { - init: function () + reset: function () { this.produced = null; this.preedit = ''; + this.preedit_saved = ''; this.cursor_pos = 0; this.marker_positions = {}; this.candidates = null; @@ -1666,18 +1922,13 @@ MIM.im_domain.DefType (MIM.State.prototype); this.changed = MIM.ChangedStatus.None; this.error_message = ''; this.title = this.initial_state.title; - this.produced = null; + this.produced = ''; this.preedit = ''; + this.preedit_saved = ''; this.marker_positions = {}; this.candidate_table = new MIM.CandidateTable (); this.candidates = null; this.candidate_show = false; - }, - - reset: function () - { - this.init (); - this.state_var_values = {}; this.shift (this.initial_state); }, @@ -1816,46 +2067,45 @@ MIM.im_domain.DefType (MIM.State.prototype); { this.candidate_table.clear (); this.produced += this.preedit; - this.preedit_replace.call (this, 0, this.preedit.Length, '', null); + this.preedit_replace.call (this, 0, this.preedit.length, '', null); } }, shift: function (state) { if (state == null) - { - MIM.log ("shifting back to previous"); - if (this.prev_state == null) - return; - state = this.prev_state; - } + { + MIM.log ("shifting back to previous"); + if (this.prev_state == null) + return; + state = this.prev_state; + } else MIM.log ("shifting to " + state.name); if (state == this.initial_state) { - this.commit (); - this.keys.val.splice (0, this.key_head); - this.key_head = 0; - if (state != this.state) + if (this.state) { - this.domain.RestoreValues (this.state_initial_var_values); - if (state.enter_actions != null) - take_actions.call (state.enter_actions); + this.commit (); + this.keys.val.splice (0, this.key_head); + this.key_head = 0; + this.prev_state = null; } - this.prev_state = null; } else - { - if (state != this.state && state.enter_actions != null) - take_actions.call (state.enter_actions); - this.prev_state = this.state; + { + if (state != this.state) + this.prev_state = this.state; } - save_state.call (this); + if (state != this.state && state.enter_actions) + take_actions.call (state.enter_actions); if (! this.state || this.state.title != state.title) this.changed |= MIM.ChangedStatus.StateTitle; this.state = state; this.keymap = state.keymap; + this.state_key_head = this.key_head; + save_state.call (this); }, Filter: function (key) @@ -1877,16 +2127,29 @@ MIM.im_domain.DefType (MIM.State.prototype); { if (! handle_key.call (this)) { - this.unhandled_key = this.keys.val[this.key_head++]; + if (this.key_head < this.keys.val.length) + { + this.unhandled_key = this.keys.val[this.key_head]; + this.keys.val.splice (this.key_head, this.key_head + 1); + } this.key_unhandled = true; break; } if (++count == 10) - break; + { + this.reset (); + this.key_unhandled = true; + break; + } } - this.keys.val.splice (0, this.key_head); - this.key_head = 0; - return (! this.key_unhandled && this.produced.length == 0); + if (this.key_unhandled) + { + this.keys.val.length = 0; + this.key_head = this.state_key_head = this.commit_key_head = 0; + } + return (! this.key_unhandled + && this.produced.length == 0 + && this.preedit.length == 0); } } @@ -1980,9 +2243,7 @@ MIM.add_event_listener MIM.log = function (msg) { var node = document.getElementById ('log'); - node.value += msg + "\n"; - var len = node.value.length; - node.setSelectionRange (len, len); + node.value = msg + "\n" + node.value; } MIM.debug_print = function (event, ic) @@ -1996,8 +2257,8 @@ MIM.debug_print = function (event, ic) MIM.debug_nodes['keypress'] = document.getElementById ('keypress'); MIM.debug_nodes['status0'] = document.getElementById ('status0'); MIM.debug_nodes['status1'] = document.getElementById ('status1'); - MIM.debug_nodes['keyseq0'] = document.getElementById ('keyseq0'); - MIM.debug_nodes['keyseq1'] = document.getElementById ('keyseq1'); + MIM.debug_nodes['keymap0'] = document.getElementById ('keymap0'); + MIM.debug_nodes['keymap1'] = document.getElementById ('keymap1'); MIM.debug_nodes['preedit0'] = document.getElementById ('preedit0'); MIM.debug_nodes['preedit1'] = document.getElementById ('preedit1'); } @@ -2013,7 +2274,7 @@ MIM.debug_print = function (event, ic) MIM.debug_nodes['status' + index].innerHTML = ic.im.load_status; else MIM.debug_nodes['status' + index].innerHTML = 'no IM'; - MIM.debug_nodes['keyseq' + index].innerHTML = ic.keys; + MIM.debug_nodes['keymap' + index].innerHTML = ic.keymap.name; MIM.debug_nodes['preedit' + index].innerHTML = ic.preedit; }; @@ -2038,15 +2299,17 @@ MIM.get_range = function (target, range) MIM.set_caret = function (target, ic) { - if (target.selectionStart != null) // Mozilla + if (target.setSelectionRange) // Mozilla { - target.focus (); + var scrollTop = target.scrollTop; target.setSelectionRange (ic.spot, ic.spot + ic.preedit.length); + target.scrollTop = scrollTop; } else // IE { var range = target.createTextRange (); - range.move ('character', pos); + range.moveStart ('character', ic.spot); + range.moveEnd ('character', ic.spot + ic.preedit.length); range.select (); } }; @@ -2057,30 +2320,40 @@ MIM.set_caret = function (target, ic) MIM.check_range = function (target, ic) { MIM.get_range (target, range); - if (range[0] != ic.spot || range[1] - range[0] != ic.preedit.length) + if (range[0] != ic.spot || range[1] - range[0] != ic.preedit.length + || target.value.substring (range[0], range[1]) != ic.preedit) { + MIM.log ('reset:' + ic.spot + '-' + (ic.spot + ic.preedit.length) + + '/' + range[0] + '-' + range[1]); ic.reset (); - ic.spot = range[0]; } + target.value = (target.value.substring (0, range[0]) + + target.value.substring (range[1])); + ic.spot = range[0]; } }) (); -MIM.update = function (target, ic, prevlen) +MIM.update = function (target, ic) { var text = target.value; target.value = (text.substring (0, ic.spot) + ic.produced + ic.preedit - + text.substring (ic.spot + prevlen)); + + text.substring (ic.spot)); ic.spot += ic.produced.length; MIM.set_caret (target, ic); }; MIM.reset_ic = function (event) { - var ic = event.target.mim_ic; - if (ic) - ic.reset (); + if (event.target.mim_ic) + { + var ic = event.target.mim_ic; + var pos = ic.spot + ic.preedit.length; + ic.reset (); + if (pos > ic.spot) + event.target.setSelectionRange (pos, pos); + } }; MIM.keydown = function (event) @@ -2092,6 +2365,7 @@ MIM.keydown = function (event) var ic = target.mim_ic; if (! ic || ic.im != MIM.current) { + MIM.log ('creating IC'); ic = new MIM.IC (MIM.current); target.mim_ic = ic; MIM.add_event_listener (target, 'blur', MIM.reset_ic); @@ -2112,7 +2386,6 @@ MIM.keypress = function (event) var i; try { - MIM.log (ic.im.name); if (ic.im.load_status != MIM.LoadStatus.Loaded) return; if (! ic.key) @@ -2123,10 +2396,11 @@ MIM.keypress = function (event) return; } - var prevlen = ic.preedit.length; MIM.log ("filtering " + ic.key); var result = ic.Filter (ic.key); - MIM.update (target, ic, prevlen); + MIM.update (event.target, ic); + if (! ic.key_unhandled) + event.preventDefault (); } finally { MIM.debug_print (event, ic); } @@ -2140,17 +2414,20 @@ MIM.select_im = function (event) target = target.parentNode; var idx = 0; var im = false; - for (var lang in MIM.list) - for (var name in MIM.list[lang]) + for (var lang in MIM.im_list) + for (var name in MIM.im_list[lang]) if (idx++ == target.selectedIndex) { - im = MIM.list[lang][name]; + im = MIM.im_list[lang][name]; break; } document.getElementsByTagName ('body')[0].removeChild (target); target.target.focus (); if (im && im != MIM.current) - MIM.current = MIM.load_sync (im); + { + MIM.current = im; + MIM.log ('select IM: ' + im.name); + } }; MIM.destroy_menu = function (event) @@ -2175,15 +2452,15 @@ MIM.select_menu = function (event) sel.style.top = (event.clientY - 10) + "px"; sel.target = target; var idx = 0; - for (var lang in MIM.list) - for (var name in MIM.list[lang]) + for (var lang in MIM.im_list) + for (var name in MIM.im_list[lang]) { var option = document.createElement ('option'); var imname = lang + "-" + name; option.appendChild (document.createTextNode (imname)); option.value = imname; sel.appendChild (option); - if (MIM.list[lang][name] == MIM.current) + if (MIM.im_list[lang][name] == MIM.current) sel.selectedIndex = idx; idx++; } @@ -2221,7 +2498,7 @@ MIM.init = function () MIM.add_event_listener (window, 'mousedown', MIM.select_menu); if (window.location == 'http://localhost/mim/index.html') MIM.server = 'http://localhost/mim'; - MIM.current = MIM.im_list['t']['latn-post']; + MIM.current = MIM.im_list['vi']['telex']; }; MIM.init_debug = function ()