|
|
|
@ -47,7 +47,7 @@ send_keycode(struct controller *controller, enum android_keycode keycode,
|
|
|
|
|
if (actions & ACTION_DOWN) {
|
|
|
|
|
msg.inject_keycode.action = AKEY_EVENT_ACTION_DOWN;
|
|
|
|
|
if (!controller_push_msg(controller, &msg)) {
|
|
|
|
|
LOGW("Cannot request 'inject %s (DOWN)'", name);
|
|
|
|
|
LOGW("Could not request 'inject %s (DOWN)'", name);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -55,7 +55,7 @@ send_keycode(struct controller *controller, enum android_keycode keycode,
|
|
|
|
|
if (actions & ACTION_UP) {
|
|
|
|
|
msg.inject_keycode.action = AKEY_EVENT_ACTION_UP;
|
|
|
|
|
if (!controller_push_msg(controller, &msg)) {
|
|
|
|
|
LOGW("Cannot request 'inject %s (UP)'", name);
|
|
|
|
|
LOGW("Could not request 'inject %s (UP)'", name);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -102,7 +102,7 @@ press_back_or_turn_screen_on(struct controller *controller) {
|
|
|
|
|
msg.type = CONTROL_MSG_TYPE_BACK_OR_SCREEN_ON;
|
|
|
|
|
|
|
|
|
|
if (!controller_push_msg(controller, &msg)) {
|
|
|
|
|
LOGW("Cannot request 'turn screen on'");
|
|
|
|
|
LOGW("Could not request 'turn screen on'");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -112,7 +112,7 @@ expand_notification_panel(struct controller *controller) {
|
|
|
|
|
msg.type = CONTROL_MSG_TYPE_EXPAND_NOTIFICATION_PANEL;
|
|
|
|
|
|
|
|
|
|
if (!controller_push_msg(controller, &msg)) {
|
|
|
|
|
LOGW("Cannot request 'expand notification panel'");
|
|
|
|
|
LOGW("Could not request 'expand notification panel'");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -122,7 +122,7 @@ collapse_notification_panel(struct controller *controller) {
|
|
|
|
|
msg.type = CONTROL_MSG_TYPE_COLLAPSE_NOTIFICATION_PANEL;
|
|
|
|
|
|
|
|
|
|
if (!controller_push_msg(controller, &msg)) {
|
|
|
|
|
LOGW("Cannot request 'collapse notification panel'");
|
|
|
|
|
LOGW("Could not request 'collapse notification panel'");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -132,7 +132,7 @@ request_device_clipboard(struct controller *controller) {
|
|
|
|
|
msg.type = CONTROL_MSG_TYPE_GET_CLIPBOARD;
|
|
|
|
|
|
|
|
|
|
if (!controller_push_msg(controller, &msg)) {
|
|
|
|
|
LOGW("Cannot request device clipboard");
|
|
|
|
|
LOGW("Could not request device clipboard");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -140,7 +140,7 @@ static void
|
|
|
|
|
set_device_clipboard(struct controller *controller) {
|
|
|
|
|
char *text = SDL_GetClipboardText();
|
|
|
|
|
if (!text) {
|
|
|
|
|
LOGW("Cannot get clipboard text: %s", SDL_GetError());
|
|
|
|
|
LOGW("Could not get clipboard text: %s", SDL_GetError());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (!*text) {
|
|
|
|
@ -155,7 +155,7 @@ set_device_clipboard(struct controller *controller) {
|
|
|
|
|
|
|
|
|
|
if (!controller_push_msg(controller, &msg)) {
|
|
|
|
|
SDL_free(text);
|
|
|
|
|
LOGW("Cannot request 'set device clipboard'");
|
|
|
|
|
LOGW("Could not request 'set device clipboard'");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -167,7 +167,7 @@ set_screen_power_mode(struct controller *controller,
|
|
|
|
|
msg.set_screen_power_mode.mode = mode;
|
|
|
|
|
|
|
|
|
|
if (!controller_push_msg(controller, &msg)) {
|
|
|
|
|
LOGW("Cannot request 'set screen power mode'");
|
|
|
|
|
LOGW("Could not request 'set screen power mode'");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -191,7 +191,7 @@ static void
|
|
|
|
|
clipboard_paste(struct controller *controller) {
|
|
|
|
|
char *text = SDL_GetClipboardText();
|
|
|
|
|
if (!text) {
|
|
|
|
|
LOGW("Cannot get clipboard text: %s", SDL_GetError());
|
|
|
|
|
LOGW("Could not get clipboard text: %s", SDL_GetError());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (!*text) {
|
|
|
|
@ -205,7 +205,7 @@ clipboard_paste(struct controller *controller) {
|
|
|
|
|
msg.inject_text.text = text;
|
|
|
|
|
if (!controller_push_msg(controller, &msg)) {
|
|
|
|
|
SDL_free(text);
|
|
|
|
|
LOGW("Cannot request 'paste clipboard'");
|
|
|
|
|
LOGW("Could not request 'paste clipboard'");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -222,12 +222,12 @@ input_manager_process_text_input(struct input_manager *input_manager,
|
|
|
|
|
msg.type = CONTROL_MSG_TYPE_INJECT_TEXT;
|
|
|
|
|
msg.inject_text.text = SDL_strdup(event->text);
|
|
|
|
|
if (!msg.inject_text.text) {
|
|
|
|
|
LOGW("Cannot strdup input text");
|
|
|
|
|
LOGW("Could not strdup input text");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (!controller_push_msg(input_manager->controller, &msg)) {
|
|
|
|
|
SDL_free(msg.inject_text.text);
|
|
|
|
|
LOGW("Cannot request 'inject text'");
|
|
|
|
|
LOGW("Could not request 'inject text'");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -368,7 +368,7 @@ input_manager_process_key(struct input_manager *input_manager,
|
|
|
|
|
struct control_msg msg;
|
|
|
|
|
if (input_key_from_sdl_to_android(event, &msg)) {
|
|
|
|
|
if (!controller_push_msg(controller, &msg)) {
|
|
|
|
|
LOGW("Cannot request 'inject keycode'");
|
|
|
|
|
LOGW("Could not request 'inject keycode'");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -385,7 +385,7 @@ input_manager_process_mouse_motion(struct input_manager *input_manager,
|
|
|
|
|
input_manager->screen->frame_size,
|
|
|
|
|
&msg)) {
|
|
|
|
|
if (!controller_push_msg(input_manager->controller, &msg)) {
|
|
|
|
|
LOGW("Cannot request 'inject mouse motion event'");
|
|
|
|
|
LOGW("Could not request 'inject mouse motion event'");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -431,7 +431,7 @@ input_manager_process_mouse_button(struct input_manager *input_manager,
|
|
|
|
|
input_manager->screen->frame_size,
|
|
|
|
|
&msg)) {
|
|
|
|
|
if (!controller_push_msg(input_manager->controller, &msg)) {
|
|
|
|
|
LOGW("Cannot request 'inject mouse button event'");
|
|
|
|
|
LOGW("Could not request 'inject mouse button event'");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -446,7 +446,7 @@ input_manager_process_mouse_wheel(struct input_manager *input_manager,
|
|
|
|
|
struct control_msg msg;
|
|
|
|
|
if (mouse_wheel_from_sdl_to_android(event, position, &msg)) {
|
|
|
|
|
if (!controller_push_msg(input_manager->controller, &msg)) {
|
|
|
|
|
LOGW("Cannot request 'inject mouse wheel event'");
|
|
|
|
|
LOGW("Could not request 'inject mouse wheel event'");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|