/InitialIseName = Tizen Keyboard
/PreloadKeyboardIse = true
/LaunchIseOnRequest = false
+/ChangeKeyboardModeByTouch = false
static bool _on_the_spot = true;
static bool _shared_input_method = false;
+static bool _change_keyboard_mode_by_touch = false;
+
static double space_key_time = 0.0;
static Eina_Bool autoperiod_allow = EINA_FALSE;
ecore_imf_context_input_panel_hide (active_ctx);
} else {
if (_click_timer == NULL) {
- if (get_hardware_keyboard_mode ()) {
+ if (get_keyboard_mode () == TOOLBAR_KEYBOARD_MODE) {
ecore_x_window_prop_card32_set (_input_win, ecore_x_atom_get (PROP_X_EXT_KEYBOARD_EXIST), &val, 1);
ecore_timer_add (0.1, _panel_show, NULL);
} else {
Eina_Bool uppercase;
EcoreIMFContextISF *context_scim;
- if (get_hardware_keyboard_mode ()) return EINA_FALSE;
+ if (get_keyboard_mode () == TOOLBAR_KEYBOARD_MODE) return EINA_FALSE;
if (!ctx) return EINA_FALSE;
context_scim = (EcoreIMFContextISF *)ecore_imf_context_data_get (ctx);
else
LOGD ("ctx : %p input panel enable : FALSE\n", ctx);
- if (get_hardware_keyboard_mode ())
+ if (get_keyboard_mode () == TOOLBAR_KEYBOARD_MODE)
clear_hide_request ();
}
/* Hardware input detect code */
if (type == ECORE_IMF_EVENT_KEY_DOWN) {
Ecore_IMF_Event_Key_Down *ev = (Ecore_IMF_Event_Key_Down *)event;
- if (ev->timestamp > 1 && get_hardware_keyboard_mode () == EINA_FALSE &&
+ if (ev->timestamp > 1 && get_keyboard_mode () == TOOLBAR_HELPER_MODE &&
scim_string_to_key (key, ev->key) &&
key.code != 0xFF69 /* Cancel (Power + Volume down) key */) {
- isf_imf_context_set_hardware_keyboard_mode (ctx);
+ isf_imf_context_set_keyboard_mode (ctx, TOOLBAR_KEYBOARD_MODE);
_panel_client.prepare (ic->id);
_panel_client.get_active_helper_option (&_active_helper_option);
_panel_client.send ();
} else if (type == ECORE_IMF_EVENT_MOUSE_UP) {
if (ecore_imf_context_input_panel_enabled_get (ctx)) {
LOGD ("[Mouse-up event] ctx : %p\n", ctx);
- if (ic == _focused_ic)
- ecore_imf_context_input_panel_show (ctx);
+ if (ic == _focused_ic) {
+ if (_change_keyboard_mode_by_touch && get_keyboard_mode () == TOOLBAR_KEYBOARD_MODE) {
+ isf_imf_context_set_keyboard_mode (ctx, TOOLBAR_HELPER_MODE);
+ LOGD("S/W keyboard mode by enabling ChangeKeyboardModeByTouch");
+ } else {
+ ecore_imf_context_input_panel_show (ctx);
+ }
+ }
else
LOGE ("Can't show IME because there is no focus. ctx : %p\n", ctx);
}
}
if (!_focused_ic || !_focused_ic->impl || !_focused_ic->impl->is_on) {
ret = EINA_FALSE;
- } else if (get_hardware_keyboard_mode () && (_active_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)) {
+ } else if (get_keyboard_mode () == TOOLBAR_KEYBOARD_MODE && (_active_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)) {
_panel_client.process_key_event (key, (int*)&ret);
} else {
ret = _focused_ic->impl->si->process_key_event (key);
if (ecore_imf_context_input_panel_layout_get (ic->ctx) == ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL &&
ic->impl->shift_mode_enabled &&
ic->impl->autocapital_type != ECORE_IMF_AUTOCAPITAL_TYPE_NONE &&
- get_hardware_keyboard_mode () == EINA_FALSE) {
+ get_keyboard_mode () == TOOLBAR_HELPER_MODE) {
char converted[2] = {'\0'};
if (utf8_wcstombs (str).length () == 1) {
Eina_Bool uppercase;
_on_the_spot = config->read (String (SCIM_CONFIG_FRONTEND_ON_THE_SPOT), _on_the_spot);
_shared_input_method = config->read (String (SCIM_CONFIG_FRONTEND_SHARED_INPUT_METHOD), _shared_input_method);
+ _change_keyboard_mode_by_touch = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_CHANGE_KEYBOARD_MODE_BY_TOUCH), _change_keyboard_mode_by_touch);
// Get keyboard layout setting
// Flush the global config first, in order to load the new configs from disk.
return 0;
}
-int _isf_imf_context_set_hardware_keyboard_mode (int context)
+int _isf_imf_context_set_keyboard_mode (int context, TOOLBAR_MODE_T mode)
{
_panel_client.prepare (context);
- _panel_client.set_hardware_keyboard_mode ();
+ _panel_client.set_keyboard_mode (mode);
_panel_client.send ();
return 0;
}
#ifndef __ISF_IMF_CONTROL_H
#define __ISF_IMF_CONTROL_H
+#define Uses_SCIM_PANEL_CLIENT
+
#include <Ecore_IMF.h>
+#include "scim.h"
#ifdef __cplusplus
extern "C"
int _isf_imf_context_input_panel_send_will_show_ack (int context);
int _isf_imf_context_input_panel_send_will_hide_ack (int context);
- int _isf_imf_context_set_hardware_keyboard_mode (int context);
+ int _isf_imf_context_set_keyboard_mode (int context, scim::TOOLBAR_MODE_T mode);
int _isf_imf_context_input_panel_send_candidate_will_hide_ack (int context);
static Ecore_Event_Handler *_prop_change_handler = NULL;
static Ecore_X_Atom prop_x_keyboard_input_detected = 0;
static Ecore_X_Window _control_win;
-static Eina_Bool hw_kbd_mode = EINA_FALSE;
+static TOOLBAR_MODE_T kbd_mode = TOOLBAR_HELPER_MODE;
static Ecore_Timer *hide_timer = NULL;
static Ecore_Timer *will_show_timer = NULL;
Ecore_IMF_Input_Panel_State input_panel_state = ECORE_IMF_INPUT_PANEL_STATE_HIDE;
return ECORE_CALLBACK_PASS_ON;
if (val == 0) {
- hw_kbd_mode = EINA_FALSE;
- LOGD ("H/W keyboard mode : %d\n", hw_kbd_mode);
+ kbd_mode = TOOLBAR_HELPER_MODE;
+ LOGD ("keyboard mode(0:H/W Keyboard, 1:S/W Keyboard): %d\n", kbd_mode);
}
}
_event_callback_call (type, value);
}
-Eina_Bool get_hardware_keyboard_mode ()
+TOOLBAR_MODE_T get_keyboard_mode ()
{
- return hw_kbd_mode;
+ return kbd_mode;
}
void isf_imf_context_control_panel_show (Ecore_IMF_Context *ctx)
if (ecore_x_window_prop_card32_get (_control_win, prop_x_keyboard_input_detected, &val, 1) > 0){
if (val == 1){
- hw_kbd_mode = EINA_TRUE;
+ kbd_mode = TOOLBAR_KEYBOARD_MODE;
} else {
- hw_kbd_mode = EINA_FALSE;
+ kbd_mode = TOOLBAR_HELPER_MODE;
}
} else {
- hw_kbd_mode = EINA_FALSE;
+ kbd_mode = TOOLBAR_HELPER_MODE;
}
- LOGD ("H/W keyboard mode : %d\n", hw_kbd_mode);
+ LOGD ("keyboard mode(0:H/W Keyboard, 1:S/W Keyboard): %d\n", kbd_mode);
}
void isf_imf_input_panel_shutdown (void)
return;
}
- if (hw_kbd_mode) {
+ if (kbd_mode == TOOLBAR_KEYBOARD_MODE) {
LOGD ("H/W keyboard is existed.\n");
return;
}
}
}
-void isf_imf_context_set_hardware_keyboard_mode (Ecore_IMF_Context *ctx)
+void isf_imf_context_set_keyboard_mode (Ecore_IMF_Context *ctx, TOOLBAR_MODE_T mode)
{
if (IfInitContext == false) {
_isf_imf_context_init ();
}
- hw_kbd_mode = EINA_TRUE;
- SECURE_LOGD ("H/W keyboard mode : %d\n", hw_kbd_mode);
- _isf_imf_context_set_hardware_keyboard_mode (_get_context_id (ctx));
+ kbd_mode = mode;
+ SECURE_LOGD ("keyboard mode : %d\n", kbd_mode);
+ _isf_imf_context_set_keyboard_mode (_get_context_id (ctx), mode);
}
void isf_imf_context_input_panel_send_candidate_will_hide_ack (Ecore_IMF_Context *ctx)
#ifndef __ISF_IMF_CONTROL_UI_H
#define __ISF_IMF_CONTROL_UI_H
+#define Uses_SCIM_PANEL_CLIENT
+
#include <Ecore_IMF.h>
+#include "scim.h"
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
void input_panel_event_callback_call (Ecore_IMF_Input_Panel_Event type, int value);
- Eina_Bool get_hardware_keyboard_mode ();
+ scim::TOOLBAR_MODE_T get_keyboard_mode ();
bool process_update_input_context (int type, int value);
Ecore_IMF_Context *get_using_ic (Ecore_IMF_Input_Panel_Event type, int value);
void save_current_xid (Ecore_IMF_Context *ctx);
void isf_imf_context_input_panel_send_will_show_ack (Ecore_IMF_Context *ctx);
void isf_imf_context_input_panel_send_will_hide_ack (Ecore_IMF_Context *ctx);
- void isf_imf_context_set_hardware_keyboard_mode (Ecore_IMF_Context *ctx);
+ void isf_imf_context_set_keyboard_mode (Ecore_IMF_Context *ctx, scim::TOOLBAR_MODE_T mode);
void isf_imf_context_input_panel_send_candidate_will_hide_ack (Ecore_IMF_Context *ctx);
WINDOW_STATE_ON,
} WINDOW_STATE;
-typedef enum _KEYBOARD_MODE {
- SOFTWARE_KEYBOARD_MODE = 0,
- HARDWARE_KEYBOARD_MODE,
-} KEYBOARD_MODE;
-
typedef std::map <String, Ecore_File_Monitor *> OSPEmRepository;
static void slot_will_hide_ack (void);
static void slot_candidate_will_hide_ack (void);
-static void slot_set_hardware_keyboard_mode (void);
+static void slot_set_keyboard_mode (int mode);
static void slot_get_ise_state (int &state);
static void slot_start_default_ise (void);
static void slot_stop_default_ise (void);
static Eina_Bool efl_create_control_window (void);
static Ecore_X_Window efl_get_app_window (void);
static Ecore_X_Window efl_get_quickpanel_window (void);
-static void check_hardware_keyboard (KEYBOARD_MODE mode);
+static void check_hardware_keyboard (TOOLBAR_MODE_T mode);
static unsigned int get_ise_index (const String uuid);
static bool set_active_ise (const String &uuid, bool launch_ise);
_panel_agent->signal_connect_will_hide_ack (slot (slot_will_hide_ack));
- _panel_agent->signal_connect_set_hardware_keyboard_mode (slot (slot_set_hardware_keyboard_mode));
+ _panel_agent->signal_connect_set_keyboard_mode (slot (slot_set_keyboard_mode));
_panel_agent->signal_connect_candidate_will_hide_ack (slot (slot_candidate_will_hide_ack));
_panel_agent->signal_connect_get_ise_state (slot (slot_get_ise_state));
}
}
-static void slot_set_hardware_keyboard_mode (void)
+static void slot_set_keyboard_mode (int mode)
{
- LOGD ("slot_set_hardware_keyboard_mode called");
- check_hardware_keyboard (HARDWARE_KEYBOARD_MODE);
+ LOGD ("slot_set_keyboard_mode called (TOOLBAR_MODE : %d)\n",mode);
+
+ check_hardware_keyboard ((TOOLBAR_MODE_T)mode);
}
static void slot_get_ise_state (int &state)
*
* @return void
*/
-static void check_hardware_keyboard (KEYBOARD_MODE mode)
+static void check_hardware_keyboard (TOOLBAR_MODE_T mode)
{
SCIM_DEBUG_MAIN (3) << __FUNCTION__ << "...\n";
String helper_uuid = _config->read (SCIM_CONFIG_DEFAULT_HELPER_ISE, String (""));
String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
- if (mode == HARDWARE_KEYBOARD_MODE) {
+ if (mode == TOOLBAR_KEYBOARD_MODE) {
if (_panel_agent->get_current_toolbar_mode () == TOOLBAR_KEYBOARD_MODE) {
LOGD ("HARDWARE_KEYBOARD_MODE return");
return;
notification_status_message_post (_("Input detected from hardware keyboard"));
/* Set input detected property for isf setting */
- val = (unsigned int)HARDWARE_KEYBOARD_MODE;
+ val = 1;
ecore_x_window_prop_card32_set (_control_window, ecore_x_atom_get (PROP_X_EXT_KEYBOARD_INPUT_DETECTED), &val, 1);
ecore_x_window_prop_card32_set (ecore_x_window_root_first_get (), ecore_x_atom_get (PROP_X_EXT_KEYBOARD_INPUT_DETECTED), &val, 1);
- } else if (mode == SOFTWARE_KEYBOARD_MODE) {
+ } else if (mode == TOOLBAR_HELPER_MODE) {
LOGD ("SOFTWARE KEYBOARD MODE");
/* When switching back to S/W keyboard mode, let's hide candidate window first */
LOGD ("calling ui_candidate_hide (true, true, true)");
#endif
/* Set input detected property for isf setting */
- val = (unsigned int)SOFTWARE_KEYBOARD_MODE;
+ val = 0;
ecore_x_test_fake_key_press ("XF86MenuKB");
ecore_x_window_prop_card32_set (_control_window, ecore_x_atom_get (PROP_X_EXT_KEYBOARD_INPUT_DETECTED), &val, 1);
ecore_x_window_prop_card32_set (ecore_x_window_root_first_get (), ecore_x_atom_get (PROP_X_EXT_KEYBOARD_INPUT_DETECTED), &val, 1);
if (ecore_x_window_prop_card32_get (_input_win, ecore_x_atom_get (PROP_X_EXT_KEYBOARD_EXIST), &val, 1) > 0) {
if (val == 0) {
_panel_agent->reset_keyboard_ise ();
- check_hardware_keyboard (SOFTWARE_KEYBOARD_MODE);
+ check_hardware_keyboard (TOOLBAR_HELPER_MODE);
set_keyboard_geometry_atom_info (_app_window, get_ise_geometry ());
_panel_agent->update_input_panel_event (ECORE_IMF_INPUT_PANEL_GEOMETRY_EVENT, 0);
}
SCIM_DEBUG_MAIN (3) << __FUNCTION__ << "...\n";
/* Start default ISE */
- check_hardware_keyboard (SOFTWARE_KEYBOARD_MODE);
+ check_hardware_keyboard (TOOLBAR_HELPER_MODE);
}
static String sanitize_string (const char *str, int maxlen = 32)
return 0;
}
-int _isf_wsc_context_set_hardware_keyboard_mode (int context)
+int _isf_wsc_context_set_keyboard_mode (int context, TOOLBAR_MODE_T mode)
{
_panel_client.prepare (context);
- _panel_client.set_hardware_keyboard_mode ();
+ _panel_client.set_keyboard_mode (mode);
_panel_client.send ();
return 0;
}
#ifndef __ISF_WSC_CONTROL_H
#define __ISF_WSC_CONTROL_H
+#define Uses_SCIM_PANEL_CLIENT
+
#include <Ecore_IMF.h>
+#include "scim.h"
#ifdef __cplusplus
extern "C"
int _isf_wsc_context_input_panel_send_will_show_ack (int context);
int _isf_wsc_context_input_panel_send_will_hide_ack (int context);
- int _isf_wsc_context_set_hardware_keyboard_mode (int context);
+ int _isf_wsc_context_set_keyboard_mode (int context, scim::TOOLBAR_MODE_T mode);
int _isf_wsc_context_input_panel_send_candidate_will_hide_ack (int context);
_isf_wsc_context_input_panel_hide (get_panel_client_id (), context_id);
}
-void isf_wsc_context_set_hardware_keyboard_mode (WSCContextISF *ctx)
+void isf_wsc_context_set_keyboard_mode (WSCContextISF *ctx, TOOLBAR_MODE_T mode)
{
if (IfInitContext == false) {
_isf_wsc_context_init ();
hw_kbd_num = 1;
SECURE_LOGD ("The number of connected H/W keyboard : %d\n", hw_kbd_num);
- _isf_wsc_context_set_hardware_keyboard_mode (_get_context_id (ctx));
+ _isf_wsc_context_set_keyboard_mode (_get_context_id (ctx), mode);
}
void
#ifndef __ISF_IMF_CONTROL_UI_H
#define __ISF_IMF_CONTROL_UI_H
+#define Uses_SCIM_PANEL_CLIENT
+
#include "isf_wsc_context.h"
#include <Ecore_IMF.h>
+#include "scim.h"
#ifdef __cplusplus
extern "C"
Ecore_IMF_Input_Panel_Layout isf_wsc_context_input_panel_layout_get (WSCContextISF *ctx);
void isf_wsc_context_input_panel_caps_mode_set (WSCContextISF *ctx, unsigned int mode);
void isf_wsc_context_input_panel_caps_lock_mode_set (WSCContextISF *ctx, Eina_Bool mode);
- void isf_wsc_context_set_hardware_keyboard_mode (WSCContextISF *ctx);
+ void isf_wsc_context_set_keyboard_mode (WSCContextISF *ctx, scim::TOOLBAR_MODE_T mode);
#ifdef __cplusplus
}
#define SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID "/DefaultIseUuid"
#define SCIM_GLOBAL_CONFIG_PRELOAD_KEYBOARD_ISE "/PreloadKeyboardIse"
#define SCIM_GLOBAL_CONFIG_LAUNCH_ISE_ON_REQUEST "/LaunchIseOnRequest"
+#define SCIM_GLOBAL_CONFIG_CHANGE_KEYBOARD_MODE_BY_TOUCH "/ChangeKeyboardModeByTouch"
#define ISF_CONFIG_HARDWARE_KEYBOARD_DETECT "/isf/hw_keyboard_detect"
PanelAgentSignalVoid m_signal_will_show_ack;
PanelAgentSignalVoid m_signal_will_hide_ack;
- PanelAgentSignalVoid m_signal_set_hardware_keyboard_mode;
+ PanelAgentSignalInt m_signal_set_keyboard_mode;
PanelAgentSignalVoid m_signal_candidate_will_hide_ack;
PanelAgentSignalInt2 m_signal_get_ise_state;
std::cerr << "Read SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID is failed!!!\n";
}
- void set_hardware_keyboard_mode (int client_id)
+ void set_keyboard_mode (int client_id)
{
- SCIM_DEBUG_MAIN(4) << "PanelAgent::set_hardware_keyboard_mode ()\n";
+ SCIM_DEBUG_MAIN(4) << "PanelAgent::set_keyboard_mode ()\n";
+ uint32 mode;
+ if (m_recv_trans.get_data (mode)) {
+ m_signal_set_keyboard_mode (mode);
+ }
+
- m_signal_set_hardware_keyboard_mode ();
}
void candidate_will_hide_ack (int client_id)
return m_signal_will_hide_ack.connect (slot);
}
- Connection signal_connect_set_hardware_keyboard_mode (PanelAgentSlotVoid *slot)
+ Connection signal_connect_set_keyboard_mode (PanelAgentSlotInt *slot)
{
- return m_signal_set_hardware_keyboard_mode.connect (slot);
+ return m_signal_set_keyboard_mode.connect (slot);
}
Connection signal_connect_candidate_will_hide_ack (PanelAgentSlotVoid *slot)
will_hide_ack (client_id);
continue;
} else if (cmd == ISM_TRANS_CMD_SET_HARDWARE_KEYBOARD_MODE) {
- set_hardware_keyboard_mode (client_id);
+ set_keyboard_mode (client_id);
continue;
} else if (cmd == ISM_TRANS_CMD_SEND_CANDIDATE_WILL_HIDE_ACK) {
candidate_will_hide_ack (client_id);
}
Connection
-PanelAgent::signal_connect_set_hardware_keyboard_mode (PanelAgentSlotVoid *slot)
+PanelAgent::signal_connect_set_keyboard_mode (PanelAgentSlotInt *slot)
{
- return m_impl->signal_connect_set_hardware_keyboard_mode (slot);
+ return m_impl->signal_connect_set_keyboard_mode (slot);
}
Connection
* @{
*/
-typedef enum
-{
- TOOLBAR_KEYBOARD_MODE = 0, /* Hardware keyboard ISE */
- TOOLBAR_HELPER_MODE /* Software keyboard ISE */
-} TOOLBAR_MODE_T;
-
typedef struct _ISE_INFO
{
String uuid;
/**
* @brief Signal: Set hardware mode
*
- * slot prototype: void set_hardware_keyboard_mode (void);
+ * slot prototype: void set_keyboard_mode (void);
*/
- Connection signal_connect_set_hardware_keyboard_mode (PanelAgentSlotVoid *slot);
+ Connection signal_connect_set_keyboard_mode (PanelAgentSlotInt *slot);
/**
* @brief Signal: Notifies the client finished handling WILL_HIDE event for candidate
m_send_trans.put_command (ISM_TRANS_CMD_SEND_WILL_HIDE_ACK);
}
- void set_hardware_keyboard_mode (void) {
+ void set_keyboard_mode (int mode) {
if (m_send_refcount > 0)
m_send_trans.put_command (ISM_TRANS_CMD_SET_HARDWARE_KEYBOARD_MODE);
+ m_send_trans.put_data (mode);
+
}
void send_candidate_will_hide_ack (void) {
}
void
-PanelClient::set_hardware_keyboard_mode (void)
+PanelClient::set_keyboard_mode (int mode)
{
- m_impl->set_hardware_keyboard_mode ();
+ m_impl->set_keyboard_mode (mode);
}
void
#include <scim_panel_common.h>
namespace scim {
-
/**
* @addtogroup Panel
* @ingroup InputServiceFramework
void set_caps_mode (int mode);
void send_will_show_ack (void);
void send_will_hide_ack (void);
- void set_hardware_keyboard_mode (void);
+ void set_keyboard_mode (int mode);
void send_candidate_will_hide_ack (void);
bool get_client_id (int &client_id);
void register_client (int client_id);
* which need to communicate with Panel daemons.
* @{
*/
+typedef enum
+{
+ TOOLBAR_KEYBOARD_MODE = 0, /* Hardware keyboard ISE */
+ TOOLBAR_HELPER_MODE /* Software keyboard ISE */
+} TOOLBAR_MODE_T;
class EAPI PanelError: public Exception
{