(Android) Move android_handle_event to input_android.c
This commit is contained in:
parent
cae578fe73
commit
ebd8b29399
|
@ -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)
|
static void *android_input_init(void)
|
||||||
{
|
{
|
||||||
pads_connected = 0;
|
pads_connected = 0;
|
||||||
|
|
|
@ -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)
|
static void *android_app_entry(void *data)
|
||||||
{
|
{
|
||||||
struct android_app* android_app = (struct android_app*)data;
|
struct android_app* android_app = (struct android_app*)data;
|
||||||
|
|
|
@ -156,6 +156,7 @@ enum {
|
||||||
int8_t android_app_read_cmd (void *data);
|
int8_t android_app_read_cmd (void *data);
|
||||||
extern void engine_app_read_cmd(void);
|
extern void engine_app_read_cmd(void);
|
||||||
extern void engine_handle_cmd(void);
|
extern void engine_handle_cmd(void);
|
||||||
|
extern void android_handle_events(void);
|
||||||
|
|
||||||
extern struct android_app *g_android;
|
extern struct android_app *g_android;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue