*
*/
+#define Uses_SCIM_CONFIG_PATH
+
#include "remote_input.h"
#include "remote_input_keycode.h"
#include <iostream>
static char* surrounding_text = 0;
static int cursor_pos = 0;
+static bool launch_web_server = false;
static WebSocketServer *g_web_socket_server = NULL;
Remote_Input* Remote_Input::m_instance = NULL;
Ecore_Event_Handler *keymap_update_handler = NULL;
void Remote_Input::init (InfoManager* info_manager)
{
LOGD("Remote Input init");
+
+ launch_web_server = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_LAUNCH_WEB_SERVER), launch_web_server);
/* Create web socket server for remote input */
- g_web_socket_server = new WebSocketServer();
- if (g_web_socket_server) {
- g_web_socket_server->init();
+ if (launch_web_server) {
+ g_web_socket_server = new WebSocketServer();
+ LOGD("Lanuched Web server!");
+ if (g_web_socket_server) {
+ g_web_socket_server->init();
+ }
}
/* Create uinput device for remote input */
if (cursor_pos != cursor || strcmp (surrounding_text, text) != 0) {
cursor_pos = cursor;
surrounding_text = strdup(text);
- g_web_socket_server->get_surrounding_text(cursor, text);
+ if (g_web_socket_server)
+ g_web_socket_server->get_surrounding_text(cursor, text);
}
break;
}
#define SCIM_GLOBAL_CONFIG_DEFAULT_KBD_MODE_CHANGER_PROGRAM "/DefaultKbdModeChangerProgram"
#define SCIM_GLOBAL_CONFIG_LAUNCH_REMOTE_INPUT "/LaunchRemoteInput"
#define SCIM_GLOBAL_CONFIG_LOCK_SCREEN_CLASS_NAME "/LockScreenClassName"
+#define SCIM_GLOBAL_CONFIG_LAUNCH_WEB_SERVER "/LaunchWebServer"
#define ISF_CONFIG_HARDWARE_KEYBOARD_DETECT "/isf/hw_keyboard_detect"