- Console.Write ("(<{0}, {1}, {2}>", im.Language, im.Name, im.SubName);
- if (im.Info (out desc, out title, out vars, out cmds))
- Console.Write (" {0}, {1}, {2}, {3}", desc, title, vars, cmds);
- if (! im.Open ())
- Console.Write (" open fail");
+ MText str = args[argc + 2];
+ for (int i = 0; i < str.Length; i++)
+ {
+ MInputMethod.Key key = new MInputMethod.Key (str[i]);
+ session.HandleKey (key);
+ int pos = session.CurrentPos;
+ MText head = mt[0, pos];
+ MText preedit = session.Preedit;
+ MText tail = mt[pos, mt.Length];
+ Console.Write ("{0} -> \"{1}|{2}|{3}\" (",
+ str[i, i + 1], head, preedit, tail);
+ for (int j = 0; j < head.Length; j++)
+ Console.Write ("{0}U+{1:X4}", j == 0 ? "(" : " ", head[j]);
+ Console.Write ("|");
+ for (int j = 0; j < preedit.Length; j++)
+ Console.Write ("{0}U+{1:X4}", j == 0 ? "" : " ", preedit[j]);
+ Console.Write ("|");
+ for (int j = 0; j < tail.Length; j++)
+ Console.Write ("{0}U+{1:X4}", j == 0 ? "" : " ", tail[j]);