2 Scim-Unikey Input Method
4 Copyright (C) 2008-2009 Ubuntu-VN <http://www.ubuntu-vn.org>
5 Author: Le Quoc Tuan <mr.lequoctuan@gmail.com>
6 Home: http://scim-unikey.googlecode.com
7 License: GNU GENERAL PUBLIC LICENSE v2
10 #define Uses_SCIM_IMENGINE
11 #define Uses_SCIM_ICONV
12 #define Uses_SCIM_CONFIG_BASE
13 #define Uses_SCIM_CONFIG_PATH
20 #define _(String) dgettext(PACKAGE_NAME,String)
23 #include "scim_unikey_const.h"
25 #include "im_engine.h"
31 static unsigned char WordBreakSyms[] =
33 ',', ';', ':', '.', '!', '?', ' ', '<', '>', '=', '+', '-', '*', '/', '_', '~',
34 '`', '@', '#', '$', '%', '^', '&', '(', ')', '{', '}', '[', ']', '|', '\"', '\'', '\\',
37 static unsigned char WordAutoCommit[] =
39 '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
40 'b', 'c', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n',
41 'p', 'q', 'r', 's', 't', 'v', 'x', 'z',
42 'B', 'C', 'F', 'G', 'H', 'J', 'K', 'L', 'M', 'N',
43 'P', 'Q', 'R', 'S', 'T', 'V', 'X', 'Z'
45 const String Unikey_IMNames[] = {"Telex", "Vni", "STelex", "STelex2"};
46 const UkInputMethod Unikey_IM[] = {UkTelex, UkVni, UkSimpleTelex, UkSimpleTelex2};
47 const unsigned int NUM_INPUTMETHOD = sizeof(Unikey_IM)/sizeof(Unikey_IM[0]);
49 const String Unikey_OCNames[] = {"Unicode",
56 const unsigned int Unikey_OC[] = {CONV_CHARSET_XUTF8,
60 CONV_CHARSET_UNI_CSTRING,
62 CONV_CHARSET_UNIREF_HEX};
63 const unsigned int NUM_OUTPUTCHARSET = sizeof(Unikey_OC)/sizeof(Unikey_OC[0]);
65 extern ConfigPointer __config;
67 /*************************************************
68 **************** Unikey Instance *****************
69 *************************************************/
70 UnikeyInstance::UnikeyInstance(UnikeyFactory *factory, const String& encoding, int id)
71 :IMEngineInstanceBase(factory, encoding, id)
73 static bool t, o; //temp variable
75 CreateDefaultUnikeyOptions(&m_ukopt);
78 if can't read config, set it to default value*/
80 t = __config->read(SCIM_IMENGINE_UNIKEY_INPUTMETHOD, &m_im);
83 t = __config->read(SCIM_IMENGINE_UNIKEY_OUTPUTCHARSET, &m_oc);
86 t = __config->read(SCIM_IMENGINE_UNIKEY_PROCESSWATWORDBEGIN, &o);
87 m_process_w_AtBeginWord = t?o:SCIM_IMENGINE_UNIKEY_PROCESSWATWORDBEGIN_DEF;
90 t = __config->read(SCIM_IMENGINE_UNIKEY_FREEMARKING, &o);
91 m_ukopt.freeMarking = t?o:SCIM_IMENGINE_UNIKEY_FREEMARKING_DEF;
93 t = __config->read(SCIM_IMENGINE_UNIKEY_MODERNSTYLE, &o);
94 m_ukopt.modernStyle = t?o:SCIM_IMENGINE_UNIKEY_MODERNSTYLE_DEF;
96 t = __config->read(SCIM_IMENGINE_UNIKEY_MACROENABLED, &o);
97 m_ukopt.macroEnabled = t?o:SCIM_IMENGINE_UNIKEY_MACROENABLED_DEF;
99 t = __config->read(SCIM_IMENGINE_UNIKEY_SPELLCHECKENABLED, &o);
100 m_ukopt.spellCheckEnabled = t?o:SCIM_IMENGINE_UNIKEY_SPELLCHECKENABLED_DEF;
102 t = __config->read(SCIM_IMENGINE_UNIKEY_AUTONONVNRESTORE, &o);
103 m_ukopt.autoNonVnRestore = t?o:SCIM_IMENGINE_UNIKEY_AUTONONVNRESTORE_DEF;
105 UnikeySetOptions(&m_ukopt);
107 if (m_ukopt.macroEnabled)
109 UnikeyLoadMacroTable(getMacroFile());
113 UnikeyInstance::~UnikeyInstance()
117 void UnikeyInstance::reset()
121 m_lastkey_with_shift = false;
124 void UnikeyInstance::focus_in()
128 UnikeySetInputMethod(Unikey_IM[m_im]);
129 UnikeySetOutputCharset(Unikey_OC[m_oc]);
130 UnikeySetOptions(&m_ukopt);
133 PropertyList UnikeyInstance::CreatePropertyList()
138 Property prop("", "", "", "");
141 prop.set_key("/Unikey/InputMethod");
142 prop.set_label(Unikey_IMNames[m_im]);
144 prop.set_tip(_("Choose input method"));
145 props.push_back(prop);
147 for (i=0; i<NUM_INPUTMETHOD; i++)
149 prop.set_key(String("/Unikey/InputMethod/") + Unikey_IMNames[i] + String((uint)m_im==i?"-Checked":""));
150 prop.set_label(Unikey_IMNames[i]);
151 prop.set_icon((uint)m_im==i?SCIM_ICONDIR SCIM_UNIKEY_ICON_CHECK:"");
153 props.push_back(prop);
158 prop.set_key("/Unikey/OutputCharset");
159 prop.set_label(Unikey_OCNames[m_oc]);
161 prop.set_tip(_("Choose output charset"));
162 props.push_back(prop);
164 for (i=0; i<NUM_OUTPUTCHARSET; i++)
166 prop.set_key(String("/Unikey/OutputCharset/") + Unikey_OCNames[i] + String((uint)m_oc==i?"-Checked":""));
167 prop.set_label(Unikey_OCNames[i]);
168 prop.set_icon((uint)m_oc==i?SCIM_ICONDIR SCIM_UNIKEY_ICON_CHECK:"");
170 props.push_back(prop);
175 prop.set_key("/Unikey/Options");
176 prop.set_label(_("Options"));
177 prop.set_icon(SCIM_ICONDIR SCIM_UNIKEY_ICON_CONFIGURE);
178 prop.set_tip(_("Configure Unikey here"));
179 props.push_back(prop);
182 prop.set_key(m_ukopt.spellCheckEnabled?
183 "/Unikey/Options/SpellCheck/Disable":"/Unikey/Options/SpellCheck/Enable");
184 prop.set_label(_("Enable spell check"));
185 prop.set_icon(m_ukopt.spellCheckEnabled?SCIM_ICONDIR SCIM_UNIKEY_ICON_CHECK:"");
186 prop.set_tip(_("If enable, you can decrease mistake when typing"));
187 props.push_back(prop);
189 // auto restore keystroke
190 prop.set_key(m_ukopt.autoNonVnRestore?
191 "/Unikey/Options/AutoRestoreKeys/Disable":"/Unikey/Options/AutoRestoreKeys/Enable");
192 prop.set_label(_("Auto restore keys with invalid words"));
193 prop.set_icon(m_ukopt.autoNonVnRestore?SCIM_ICONDIR SCIM_UNIKEY_ICON_CHECK:"");
194 prop.set_tip(_("When typing a word not in Vietnamese,\n"
195 "it will auto restore keystroke into original"));
196 props.push_back(prop);
199 prop.set_key(m_ukopt.modernStyle?
200 "/Unikey/Options/ModernStyle/Disable":"/Unikey/Options/ModernStyle/Enable");
201 prop.set_label(_("Use oà , uý (instead of òa, úy)"));
202 prop.set_icon(m_ukopt.modernStyle?SCIM_ICONDIR SCIM_UNIKEY_ICON_CHECK:"");
204 props.push_back(prop);
207 prop.set_key(m_ukopt.freeMarking?
208 "/Unikey/Options/FreeMarking/Disable":"/Unikey/Options/FreeMarking/Enable");
209 prop.set_label(_("Allow type with more freedom"));
210 prop.set_icon(m_ukopt.freeMarking?SCIM_ICONDIR SCIM_UNIKEY_ICON_CHECK:"");
212 props.push_back(prop);
215 prop.set_key(m_ukopt.macroEnabled?
216 "/Unikey/Options/EnabledMacro/Disable":"/Unikey/Options/EnabledMacro/Enable");
217 prop.set_label(_("Enable Macro"));
218 prop.set_icon(m_ukopt.macroEnabled?SCIM_ICONDIR SCIM_UNIKEY_ICON_CHECK:"");
220 props.push_back(prop);
222 // process w at begin
223 prop.set_key(m_process_w_AtBeginWord?
224 "/Unikey/Options/ProcessWAtBegin/Disable":"/Unikey/Options/ProcessWAtBegin/Enable");
225 prop.set_label(_("Process W at word begin"));
226 prop.set_icon(m_process_w_AtBeginWord?SCIM_ICONDIR SCIM_UNIKEY_ICON_CHECK:"");
227 prop.set_tip(_("If enable, type W at begin\n"
228 "of word will change to Ư."));
229 props.push_back(prop);
232 prop.set_key("/Unikey/Options/RunSetup");
233 prop.set_label(_("Launch Unikey Setup"));
234 prop.set_icon(SCIM_ICONDIR SCIM_UNIKEY_ICON_MAIN);
236 props.push_back(prop);
241 void UnikeyInstance::trigger_property(const String &property)
247 if (!property.compare(0, strlen("/Unikey/InputMethod/"), "/Unikey/InputMethod/"))
249 for (i=0; i<NUM_INPUTMETHOD; i++)
250 if (!property.compare(strlen("/Unikey/InputMethod/"),
251 property.length() - strlen("/Unikey/InputMethod/"),
255 __config->write(SCIM_IMENGINE_UNIKEY_INPUTMETHOD, m_im);
262 else if (!property.compare(0, strlen("/Unikey/OutputCharset/"), "/Unikey/OutputCharset/"))
264 for (i=0; i<NUM_OUTPUTCHARSET; i++)
265 if (!property.compare(strlen("/Unikey/OutputCharset/"),
266 property.length() - strlen("/Unikey/OutputCharset/"),
270 __config->write(SCIM_IMENGINE_UNIKEY_OUTPUTCHARSET, m_oc);
277 else if (property == "/Unikey/Options/SpellCheck/Enable")
279 m_ukopt.spellCheckEnabled = true;
280 __config->write(SCIM_IMENGINE_UNIKEY_SPELLCHECKENABLED, true);
283 else if (property == "/Unikey/Options/SpellCheck/Disable")
285 m_ukopt.spellCheckEnabled = false;
286 __config->write(SCIM_IMENGINE_UNIKEY_SPELLCHECKENABLED, false);
290 // auto restore keystroke
291 else if (property == "/Unikey/Options/AutoRestoreKeys/Enable")
293 m_ukopt.autoNonVnRestore = true;
294 __config->write(SCIM_IMENGINE_UNIKEY_AUTONONVNRESTORE, true);
297 else if (property == "/Unikey/Options/AutoRestoreKeys/Disable")
299 m_ukopt.autoNonVnRestore = false;
300 __config->write(SCIM_IMENGINE_UNIKEY_AUTONONVNRESTORE, false);
305 else if (property == "/Unikey/Options/ModernStyle/Enable")
307 m_ukopt.modernStyle = true;
308 __config->write(SCIM_IMENGINE_UNIKEY_MODERNSTYLE, true);
311 else if (property == "/Unikey/Options/ModernStyle/Disable")
313 m_ukopt.modernStyle = false;
314 __config->write(SCIM_IMENGINE_UNIKEY_MODERNSTYLE, false);
319 else if (property == "/Unikey/Options/FreeMarking/Enable")
321 m_ukopt.freeMarking = true;
322 __config->write(SCIM_IMENGINE_UNIKEY_FREEMARKING, true);
325 else if (property == "/Unikey/Options/FreeMarking/Disable")
327 m_ukopt.freeMarking = false;
328 __config->write(SCIM_IMENGINE_UNIKEY_FREEMARKING, false);
332 else if (property == "/Unikey/Options/EnabledMacro/Enable")
334 m_ukopt.macroEnabled = true;
335 UnikeyLoadMacroTable(getMacroFile());
336 __config->write(SCIM_IMENGINE_UNIKEY_MACROENABLED, true);
339 else if (property == "/Unikey/Options/EnabledMacro/Disable")
341 m_ukopt.macroEnabled = false;
342 __config->write(SCIM_IMENGINE_UNIKEY_MACROENABLED, false);
346 // process w at begin
347 else if (property == "/Unikey/Options/ProcessWAtBegin/Enable")
349 m_process_w_AtBeginWord = true;
350 __config->write(SCIM_IMENGINE_UNIKEY_PROCESSWATWORDBEGIN, true);
353 else if (property == "/Unikey/Options/ProcessWAtBegin/Disable")
355 m_process_w_AtBeginWord = false;
356 __config->write(SCIM_IMENGINE_UNIKEY_PROCESSWATWORDBEGIN, false);
361 else if (property == "/Unikey/Options/RunSetup")
363 system(LIBEXECDIR "/scim-setup-unikey &");
374 /*********************************************************
375 **************** Unikey Instance Preedit *****************
376 *********************************************************/
378 UnikeyInstancePreedit::UnikeyInstancePreedit(UnikeyFactory *factory, const String &encoding, int id)
379 :UnikeyInstance(factory, encoding, id),
385 UnikeyInstancePreedit::~UnikeyInstancePreedit()
389 void UnikeyInstancePreedit::focus_in()
391 UnikeyInstance::focus_in();
392 register_properties(CreatePropertyList());
395 void UnikeyInstancePreedit::focus_out()
400 void UnikeyInstancePreedit::flush_preedit(bool commit)
402 UnikeyInstance::reset();
404 if (m_preeditstring.length())
407 commit_string(m_preeditstring);
409 hide_preedit_string();
410 m_preeditstring.clear();
412 m_auto_commit = false;
415 void UnikeyInstancePreedit::reset()
417 flush_preedit(false);
420 void UnikeyInstancePreedit::flush()
425 void UnikeyInstancePreedit::unikey_update_preedit_string(const WideString s, const bool visible)
427 AttributeList attlist;
430 // underline preedit string
431 att = Attribute(0, s.length(), SCIM_ATTR_DECORATE, SCIM_ATTR_DECORATE_UNDERLINE);
432 attlist.push_back(att);
434 if (m_ukopt.spellCheckEnabled==1 && UnikeyLastWordIsNonVn())
436 // red preedit string
437 att = Attribute(0, s.length(), SCIM_ATTR_FOREGROUND, 0xff0000);
438 attlist.push_back(att);
441 update_preedit_string(s, attlist);
442 update_preedit_caret(s.length());
446 show_preedit_string();
450 hide_preedit_string();
454 bool UnikeyInstancePreedit::process_key_event(const KeyEvent& key)
458 tmp = unikey_process_key_event(key);
460 if ((key.code >= SCIM_KEY_space && key.code <= SCIM_KEY_asciitilde)
461 || (key.code >= SCIM_KEY_KP_Multiply && key.code <= SCIM_KEY_KP_9))
463 m_lastkey_with_shift = key.is_shift_down();
467 m_lastkey_with_shift = false;
473 bool UnikeyInstancePreedit::unikey_process_key_event(const KeyEvent& key)
477 if (key.code == SCIM_KEY_Tab
478 || key.mask & SCIM_KEY_ControlMask
479 || key.mask & SCIM_KEY_AltMask)
481 if (m_preeditstring.length())
483 commit_string(m_preeditstring);
484 hide_preedit_string();
485 m_preeditstring.clear();
491 if (key.is_key_release())
494 if (key.code == SCIM_KEY_Tab
495 || key.code == SCIM_KEY_Return
496 || key.code == SCIM_KEY_Delete
497 || key.code == SCIM_KEY_KP_Enter
498 || (key.code >= SCIM_KEY_Home && key.code <= SCIM_KEY_Insert)
499 || (key.code >= SCIM_KEY_KP_Home && key.code <= SCIM_KEY_KP_Delete))
501 if (m_preeditstring.length())
503 commit_string(m_preeditstring);
504 hide_preedit_string();
505 m_preeditstring.clear();
512 else if (key.code >= SCIM_KEY_Shift_L && key.code <= SCIM_KEY_Hyper_R)
515 else if (key.code == SCIM_KEY_BackSpace)
517 UnikeyBackspacePress(); // process Backspace
519 if (UnikeyBackspaces==0 || m_preeditstring.empty()) // if Unikey tell no Backspace
522 return false; // Return Backspace to client
528 len = m_preeditstring.length();
529 if (len <= UnikeyBackspaces)
531 m_preeditstring.clear();
532 hide_preedit_string();
533 m_auto_commit = true;
537 m_preeditstring.erase(len - UnikeyBackspaces, UnikeyBackspaces);
538 unikey_update_preedit_string(m_preeditstring, true);
541 // append key that need change tone pos after press backspace
544 if (Unikey_OC[m_oc] == CONV_CHARSET_XUTF8)
545 m_preeditstring.append(utf8_mbstowcs((const char*)UnikeyBuf, UnikeyBufChars));
548 static unsigned char buf[1024];
549 int bufSize=sizeof(buf)/sizeof(buf[0]);
551 latinToUtf(buf, UnikeyBuf, UnikeyBufChars, &bufSize);
552 m_preeditstring.append(utf8_mbstowcs((const char*)buf, sizeof(buf)/sizeof(buf[0])-bufSize));
555 m_auto_commit = false;
556 unikey_update_preedit_string(m_preeditstring, true);
563 else if (key.code >= SCIM_KEY_space && key.code <= SCIM_KEY_asciitilde)
565 UnikeySetCapsState(key.mask & SCIM_KEY_ShiftMask, key.mask & SCIM_KEY_CapsLockMask);
567 // auto commit char: commit char that never change later in preedit string
568 // if macro enabled, then not auto commit. Because macro may change any word
569 if (m_ukopt.macroEnabled==0 && (UnikeyAtWordBeginning() || m_auto_commit))
571 for (i = 0; i < sizeof(WordAutoCommit); i++)
572 if (key.code == WordAutoCommit[i])
574 UnikeyPutChar(key.code);
575 m_auto_commit = true;
576 forward_key_event(key); // forward keyevent instead of return false
579 } // end auto commit char
581 if ((Unikey_IM[m_im] == UkTelex || Unikey_IM[m_im] == UkSimpleTelex2)
582 && m_process_w_AtBeginWord == false
583 && UnikeyAtWordBeginning()
584 && (key.code == SCIM_KEY_w || key.code == SCIM_KEY_W))
586 UnikeyPutChar(key.code);
587 if (m_ukopt.macroEnabled==0)
589 forward_key_event(key);
593 m_preeditstring.push_back(key.code);
594 unikey_update_preedit_string(m_preeditstring, true);
597 m_auto_commit = true;
602 m_auto_commit = false;
604 if (m_lastkey_with_shift == false
605 && key.mask & SCIM_KEY_ShiftMask
606 && key.code == SCIM_KEY_space
607 && !UnikeyAtWordBeginning())
609 UnikeyRestoreKeyStrokes();
614 UnikeyFilter(key.code);
617 if (UnikeyBackspaces > 0)
621 len = m_preeditstring.length();
623 if (len <= UnikeyBackspaces)
624 m_preeditstring.clear();
626 m_preeditstring.erase(len - UnikeyBackspaces, UnikeyBackspaces);
629 if (UnikeyBufChars > 0)
631 if (Unikey_OC[m_oc] == CONV_CHARSET_XUTF8)
632 m_preeditstring.append(utf8_mbstowcs((const char*)UnikeyBuf, UnikeyBufChars));
635 static unsigned char buf[1024];
636 int bufSize=sizeof(buf)/sizeof(buf[0]);
638 latinToUtf(buf, UnikeyBuf, UnikeyBufChars, &bufSize);
639 m_preeditstring.append(utf8_mbstowcs((const char*)buf, sizeof(buf)/sizeof(buf[0])-bufSize));
644 m_preeditstring.push_back(key.get_unicode_code());
647 if (m_preeditstring.length())
649 for (i=0; i < sizeof(WordBreakSyms); i++)
651 if (WordBreakSyms[i] == m_preeditstring[m_preeditstring.length()-1] && key.code == WordBreakSyms[i])
653 commit_string(m_preeditstring);
654 hide_preedit_string();
655 m_preeditstring.clear();
662 unikey_update_preedit_string(m_preeditstring, true);
666 // else (key non process)
671 PropertyList UnikeyInstancePreedit::CreatePropertyList()
673 return UnikeyInstance::CreatePropertyList();
676 void UnikeyInstancePreedit::trigger_property(const String &property)
678 UnikeyInstance::trigger_property(property);
682 /*********************************************************
683 **************** Unikey Instance Classic *****************
684 *********************************************************/
686 UnikeyInstanceClassic::UnikeyInstanceClassic(UnikeyFactory *factory, const String &encoding, int id)
687 :UnikeyInstance(factory, encoding, id)
692 UnikeyInstanceClassic::~UnikeyInstanceClassic()
696 void UnikeyInstanceClassic::focus_in()
698 UnikeyInstance::focus_in();
699 register_properties(CreatePropertyList());
702 void UnikeyInstanceClassic::focus_out()
707 void UnikeyInstanceClassic::reset()
709 UnikeyInstance::reset();
712 void UnikeyInstanceClassic::unikey_send_backspace(int nBackspace)
714 static WideString ws;
717 // if surrounding text was provided, use it instead of send backspace
718 if (get_surrounding_text(ws, n, nBackspace, 0))
720 // for type in Auto Complete in OpenOffice
721 // Hope this not rise bugs in others application
722 // not use SCIM_KEY_NullKey, because GTK application crash when GTK_IM_MODULE=scim
724 forward_key_event(SCIM_KEY_VoidSymbol);
726 delete_surrounding_text(-ws.length(), ws.length());
730 for (int i=0; i < nBackspace; i++)
731 forward_key_event(SCIM_KEY_BackSpace);
735 void UnikeyInstanceClassic::unikey_commit_key_event(const KeyEvent& key)
740 s.push_back(key.code);
744 bool UnikeyInstanceClassic::process_key_event(const KeyEvent& key)
748 tmp = unikey_process_key_event(key);
750 if ((key.code >= SCIM_KEY_space && key.code <= SCIM_KEY_asciitilde)
751 || (key.code >= SCIM_KEY_KP_Multiply && key.code <= SCIM_KEY_KP_9))
753 m_lastkey_with_shift = key.is_shift_down();
757 m_lastkey_with_shift = false;
763 bool UnikeyInstanceClassic::unikey_process_key_event(const KeyEvent& key)
765 if (key.is_key_release())
770 if (key.is_control_down() || key.mask & SCIM_KEY_AltMask)
776 if (key.code >= SCIM_KEY_Shift_L && key.code <= SCIM_KEY_Hyper_R)
781 if (key.code == SCIM_KEY_BackSpace)
783 UnikeyBackspacePress(); // xu ly phim backspace
784 if (UnikeyBackspaces==0) // neu ukengine bao khong can xoa ky tu nao,
785 return false; // thi tra lai backspace cho chuong trinh khach
788 unikey_send_backspace(UnikeyBackspaces);
790 // append key that need change tone pos after press backspace
793 if (Unikey_OC[m_oc] == CONV_CHARSET_XUTF8)
794 commit_string(utf8_mbstowcs((const char*)UnikeyBuf, UnikeyBufChars)); // send the solved string to client
797 static unsigned char buf[1024];
798 int bufSize=sizeof(buf)/sizeof(buf[0]);
800 latinToUtf(buf, UnikeyBuf, UnikeyBufChars, &bufSize);
801 commit_string(utf8_mbstowcs((const char*)buf, sizeof(buf)/sizeof(buf[0]) - bufSize));
809 if (key.code >= SCIM_KEY_space && key.code <= SCIM_KEY_asciitilde)
811 UnikeySetCapsState(key.mask & SCIM_KEY_ShiftMask,
812 key.mask & SCIM_KEY_CapsLockMask);
814 // shift + space to restore keystroke
815 if (m_lastkey_with_shift == false
816 && key.mask & SCIM_KEY_ShiftMask
817 && key.code == SCIM_KEY_space
818 && !UnikeyAtWordBeginning())
820 UnikeyRestoreKeyStrokes();
821 if (UnikeyBackspaces == 0)
823 UnikeyPutChar(key.code);
827 else if ((Unikey_IM[m_im] == UkTelex || Unikey_IM[m_im] == UkSimpleTelex2)
828 && m_process_w_AtBeginWord == false
829 && UnikeyAtWordBeginning()
830 && (key.code == SCIM_KEY_w || key.code == SCIM_KEY_W))
832 UnikeyPutChar(key.code);
837 UnikeyFilter(key.code);
840 if (UnikeyBackspaces)
842 unikey_send_backspace(UnikeyBackspaces);
847 if (Unikey_OC[m_oc] == CONV_CHARSET_XUTF8)
849 commit_string(utf8_mbstowcs((const char*)UnikeyBuf, UnikeyBufChars)); // send the solved string to client
853 static unsigned char buf[1024];
854 int bufSize=sizeof(buf)/sizeof(buf[0]);
856 latinToUtf(buf, UnikeyBuf, UnikeyBufChars, &bufSize);
857 commit_string(utf8_mbstowcs((const char*)buf, sizeof(buf)/sizeof(buf[0]) - bufSize));
862 unikey_commit_key_event(key);
874 PropertyList UnikeyInstanceClassic::CreatePropertyList()
876 return UnikeyInstance::CreatePropertyList();
879 void UnikeyInstanceClassic::trigger_property(const String &property)
881 UnikeyInstance::trigger_property(property);