Question
I'm developing a Tizen 2.4 Mobile native application (not IME model) and trying to implement a virtual keyboard using ELM's Entry widget. I'm facing two specific issues:
- Unable to hide the cursor in the Entry widget
- The virtual keyboard always appears in portrait mode, even when the application window is rotated to 270 degrees (landscape mode)
Here's my current implementation:
// Window setup
ad->win = add_win(ad->name);
elm_win_rotation_set(ad->win, 270);
// Indicator settings
elm_win_conformant_set(ad->win, EINA_TRUE);
elm_win_indicator_mode_set(ad->win, ELM_WIN_INDICATOR_SHOW);
elm_win_indicator_opacity_set(ad->win, ELM_WIN_INDICATOR_TRANSPARENT);
// Conformant and keyboard creation
ad->conform = create_conform(ad->win);
ad->virtual_kb = create_virtual_kb(ad->conform);
The create_virtual_kb() function:
static Evas_Object* create_virtual_kb(Evas_Object* parent) {
if (parent == NULL) return NULL;
Evas_Object *vkb = elm_entry_add(parent);
elm_object_focus_set(vkb, EINA_FALSE);
evas_object_smart_callback_add(vkb, "changed", vkb_changed_cb, vkb);
elm_entry_single_line_set(vkb, EINA_TRUE);
elm_entry_input_panel_return_key_type_set(vkb, ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE);
return vkb;
}
Are there any sample codes or solutions that address these two specific problems?
Answer
Problem Understanding
The developer is facing two main challenges:
- Cursor visibility control in ELM Entry widget
- Virtual keyboard orientation mismatch with the application window
Solution Methods
-
For cursor visibility:
- Use
elm_entry_cursor_visible_set()API to control cursor visibility - Example:
elm_entry_cursor_visible_set(vkb, EINA_FALSE);
- Use
-
For keyboard orientation:
- The virtual keyboard orientation is typically controlled by the system and may not automatically follow application rotation
- Consider using the Input Method Editor (IME) model instead of the native UI model for better keyboard control
- Alternatively, you can try forcing the keyboard orientation using
elm_win_rotation_with_resize_set()
Code Examples
For cursor visibility:
static Evas_Object* create_virtual_kb(Evas_Object* parent) {
if (parent == NULL) return NULL;
Evas_Object *vkb = elm_entry_add(parent);
elm_object_focus_set(vkb, EINA_FALSE);
elm_entry_cursor_visible_set(vkb, EINA_FALSE); // Hide cursor
// ... rest of the code
}
Additional Tips
- For more comprehensive keyboard control, consider examining these sample projects:
- Tizen IDE > File > New > Tizen Native Project > Template > Mobile-2.4 > Input Method Editor
- Tizen IDE > File > New > Tizen Native Project > Online Sample > UIX > IME Sample
- Note that keyboard behavior might be device-dependent in some cases
- For Tizen 2.4, some keyboard features might be limited compared to newer versions