From d4e9ddbd15f873c18b6f517e0c7417193e3fe190 Mon Sep 17 00:00:00 2001 From: Markuss Broks Date: Sat, 16 Mar 2024 17:09:04 +0000 Subject: [PATCH] libandroid: Add a stub for AKeyEvent_getKeyCode --- src/libandroid/input.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/libandroid/input.c b/src/libandroid/input.c index c0e234ef..35eba7a4 100644 --- a/src/libandroid/input.c +++ b/src/libandroid/input.c @@ -254,3 +254,17 @@ void AInputQueue_finishEvent(AInputQueue* queue, struct AInputEvent* event, int { // should we do something here? } + +void AKeyEvent_getKeyCode (struct AInputEvent *event) +{ + /* + * TODO: Minecraft PE misuses this function on an event + * that is not an AINPUT_EVENT_TYPE_KEY, which would lead to + * undefined behaviour, so we would need to check if the event + * is of type AINPUT_EVENT_TYPE_KEY before casting it to anything + * to not break Minecraft PE when we actually implement this function. + */ + + printf("HACK: getKeyCode stubbed, returning 0!"); + return 0; +}