(Android) Fixed bug where device name was not being shown long enough

- useful for debugging input
This commit is contained in:
twinaphex 2013-01-27 06:51:44 +01:00
parent e31db3bf20
commit 3e0575b320
2 changed files with 4 additions and 5 deletions

View File

@ -98,6 +98,7 @@ static void android_input_poll(void *data)
if (AInputQueue_getEvent(android_app->inputQueue, &event) < 0)
break;
bool long_msg_enable = false;
int32_t handled = 1;
int action = 0;
char msg[128];
@ -120,6 +121,7 @@ static void android_input_poll(void *data)
state_device_ids[pads_connected++] = id;
input_autodetect_setup(android_app, msg, sizeof(msg), state_id, id, source);
long_msg_enable = true;
}
if (keycode == AKEYCODE_BACK && (source & (AINPUT_SOURCE_KEYBOARD)))
@ -213,7 +215,7 @@ static void android_input_poll(void *data)
}
if (msg[0] != 0)
msg_queue_push(g_extern.msg_queue, msg, 0, 30);
msg_queue_push(g_extern.msg_queue, msg, 0, long_msg_enable ? 180 : 30);
AInputQueue_finishEvent(android_app->inputQueue, event, handled);
}

View File

@ -568,8 +568,5 @@ void input_autodetect_setup (void *data, char *msg, size_t sizeof_msg, unsigned
}
if (name_buf[0] != 0)
RARCH_LOG("Device %d: %s, port: %d.\n", id, name_buf, port);
if (msg[0] == 0 && name_buf[0] != 0)
snprintf(msg, sizeof_msg, "HID [%s] unbound.\n", name_buf);
snprintf(msg, sizeof_msg, "HID %s %d: %s, port: %d.\n", msg[0] == 0 ? "Unbound" : "", id, name_buf, port);
}