(Android) Move android_handle_event to input_android.c

This commit is contained in:
twinaphex 2013-03-03 20:17:00 +01:00
parent cae578fe73
commit ebd8b29399
3 changed files with 15 additions and 14 deletions

View File

@ -347,6 +347,20 @@ void engine_handle_input(void)
}
}
// Handle all events. If our activity is in pause state, block until we're unpaused.
void android_handle_events(void)
{
int ident;
while ((ident = ALooper_pollAll((input_key_pressed_func(RARCH_PAUSE_TOGGLE)) ? -1 : 0,
NULL, NULL, NULL)) >= 0)
{
if (ident == LOOPER_ID_MAIN)
engine_handle_cmd();
else if (!input_key_pressed_func(RARCH_PAUSE_TOGGLE))
engine_handle_input();
}
}
static void *android_input_init(void)
{
pads_connected = 0;

View File

@ -176,20 +176,6 @@ static bool android_app_start_main(struct android_app *android_app, int *init_re
}
}
// Handle all events. If our activity is in pause state, block until we're unpaused.
static void android_handle_events(void)
{
int ident;
while ((ident = ALooper_pollAll((input_key_pressed_func(RARCH_PAUSE_TOGGLE)) ? -1 : 0,
NULL, NULL, NULL)) >= 0)
{
if (ident == LOOPER_ID_MAIN)
engine_handle_cmd();
else if (!input_key_pressed_func(RARCH_PAUSE_TOGGLE))
engine_handle_input();
}
}
static void *android_app_entry(void *data)
{
struct android_app* android_app = (struct android_app*)data;

View File

@ -156,6 +156,7 @@ enum {
int8_t android_app_read_cmd (void *data);
extern void engine_app_read_cmd(void);
extern void engine_handle_cmd(void);
extern void android_handle_events(void);
extern struct android_app *g_android;