mirror of
https://github.com/kichikuou/system3-sdl2.git
synced 2026-10-04 12:58:01 +03:00
Android: Add system menu
The system menu opens with 3-finger touch. Currently, it can only exit the game.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user