@@ -146,6 +146,12 @@ TizenInputMethodContext::TizenInputMethodContext(uintptr_t window_id) {
146146TizenInputMethodContext::~TizenInputMethodContext () {
147147 UnregisterEventCallbacks ();
148148
149+ #ifdef NUI_SUPPORT
150+ if (ecore_device_) {
151+ ecore_device_del (ecore_device_);
152+ }
153+ #endif
154+
149155 if (imf_context_) {
150156 ecore_imf_context_del (imf_context_);
151157 }
@@ -191,6 +197,51 @@ bool TizenInputMethodContext::HandleEvasEventKeyUp(Evas_Event_Key_Up* event) {
191197 reinterpret_cast <Ecore_IMF_Event*>(&imf_event));
192198}
193199
200+ #ifdef NUI_SUPPORT
201+ bool TizenInputMethodContext::HandleNuiKeyEvent (const char * device_name,
202+ uint32_t device_class,
203+ uint32_t device_subclass,
204+ const char * key,
205+ const char * string,
206+ uint32_t modifiers,
207+ uint32_t scan_code,
208+ size_t timestamp,
209+ bool is_down) {
210+ Ecore_Event_Key event;
211+ event.keyname = event.key = key ? key : " " ;
212+ event.string = string ? string : " " ;
213+ event.modifiers = modifiers;
214+ event.keycode = scan_code;
215+ event.timestamp = timestamp;
216+ if (device_name) {
217+ if (!ecore_device_) {
218+ ecore_device_ = ecore_device_add ();
219+ }
220+
221+ event.dev = ecore_device_;
222+ ecore_device_name_set (event.dev , device_name);
223+ ecore_device_class_set (event.dev ,
224+ static_cast <Ecore_IMF_Device_Class>(device_class));
225+ ecore_device_subclass_set (
226+ event.dev , static_cast <Ecore_IMF_Device_Subclass>(device_subclass));
227+ }
228+
229+ if (is_down) {
230+ Ecore_IMF_Event_Key_Down imf_event =
231+ EcoreEventKeyToEcoreImfEvent<Ecore_IMF_Event_Key_Down>(&event);
232+ return ecore_imf_context_filter_event (
233+ imf_context_, ECORE_IMF_EVENT_KEY_DOWN,
234+ reinterpret_cast <Ecore_IMF_Event*>(&imf_event));
235+ } else {
236+ Ecore_IMF_Event_Key_Up imf_event =
237+ EcoreEventKeyToEcoreImfEvent<Ecore_IMF_Event_Key_Up>(&event);
238+ return ecore_imf_context_filter_event (
239+ imf_context_, ECORE_IMF_EVENT_KEY_UP,
240+ reinterpret_cast <Ecore_IMF_Event*>(&imf_event));
241+ }
242+ }
243+ #endif
244+
194245InputPanelGeometry TizenInputMethodContext::GetInputPanelGeometry () {
195246 FT_ASSERT (imf_context_);
196247 InputPanelGeometry geometry;
0 commit comments