From 60f0d7a11bb10e535429366b96ae54b951831bb6 Mon Sep 17 00:00:00 2001 From: Vadim Grigoruk Date: Fri, 24 Aug 2018 22:24:20 +0300 Subject: [PATCH] #704 fixed BACK button on Android --- build/android/jni/src/Android.mk | 2 +- src/system.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/build/android/jni/src/Android.mk b/build/android/jni/src/Android.mk index bf603df..f95f054 100644 --- a/build/android/jni/src/Android.mk +++ b/build/android/jni/src/Android.mk @@ -1,7 +1,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -LOCAL_CFLAGS += -O3 -Wall -std=gnu99 -D"log2(x)=(log(x)/log(2))" +LOCAL_CFLAGS += -O3 -Wall -std=gnu99 -D"log2(x)=(log(x)/log(2))" -DTIC80_PRO LOCAL_MODULE := main SRC_PATH := ../../../../src diff --git a/src/system.c b/src/system.c index c20bdf9..51c7566 100644 --- a/src/system.c +++ b/src/system.c @@ -430,8 +430,10 @@ static void processKeyboard() for(s32 i = 0; i < SDL_NUM_SCANCODES && c < BufSize; i++) { if(keyboard[i]) - { - u32 keycode = SDL_GetKeyFromScancode(i); + { + SDL_Keycode keycode = i == SDL_SCANCODE_AC_BACK + ? SDLK_ESCAPE + : SDL_GetKeyFromScancode(i); for(s32 k = 0; k < COUNT_OF(KeyboardCodes); k++) {