From 763a925a17f17cad4f9e5929d7ba03be1314340d Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 29 Oct 2016 04:59:56 +0200 Subject: [PATCH] Fix Android build --- input/drivers/android_input.c | 18 +++++++++++++++++- menu/menu_event.c | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/input/drivers/android_input.c b/input/drivers/android_input.c index d1cab46446..515f24023e 100644 --- a/input/drivers/android_input.c +++ b/input/drivers/android_input.c @@ -1039,6 +1039,22 @@ static void android_input_poll_memcpy(void *data) } } +static bool android_input_key_pressed(void *data, int key) +{ + android_input_t *android = (android_input_t*)data; + settings_t *settings = config_get_ptr(); + + if(settings->input.binds[0][key].valid && android_keyboard_port_input_pressed(settings->input.binds[0],key)) + return true; + + if (settings->input.binds[0][key].valid && + input_joypad_pressed(android->joypad, + 0, settings->input.binds[0], key)) + return true; + + return false; +} + /* Handle all events. If our activity is in pause state, * block until we're unpaused. */ @@ -1049,7 +1065,7 @@ static void android_input_poll(void *data) struct android_app *android_app = (struct android_app*)g_android; while ((ident = - ALooper_pollAll((input_driver_key_pressed(&key)) + ALooper_pollAll((android_input_key_pressed(data, key)) ? -1 : 1, NULL, NULL, NULL)) >= 0) { diff --git a/menu/menu_event.c b/menu/menu_event.c index fb0e6fcaf1..3e4ba6d4d0 100644 --- a/menu/menu_event.c +++ b/menu/menu_event.c @@ -29,7 +29,6 @@ #include "menu_event.h" -#include "content.h" #include "menu_driver.h" #include "menu_input.h" #include "menu_animation.h" @@ -39,6 +38,7 @@ #include "widgets/menu_dialog.h" #include "../configuration.h" +#include "../content.h" #include "../retroarch.h" #include "../runloop.h"