Android: Add system menu

The system menu opens with 3-finger touch. Currently, it can only exit
the game.
This commit is contained in:
kichikuou
2020-11-29 18:27:50 +09:00
parent 04206abb77
commit 602c309c47
12 changed files with 73 additions and 13 deletions
+10 -1
View File
@@ -47,6 +47,15 @@ void NACT::output_console(const char *format, ...)
#endif
}
void NACT::on_syswmevent(SDL_SysWMmsg* msg)
bool NACT::handle_platform_event(const SDL_Event& e)
{
if (e.type == SDL_FINGERDOWN && SDL_GetNumTouchFingers(e.tfinger.touchId) == 3) {
JNILocalFrame jni(16);
if (jni.env()) {
jmethodID mid = jni.GetMethodID("popupMenu", "()V");
jni.env()->CallVoidMethod(jni.context(), mid);
return true;
}
}
return false;
}