ANDROID back and menu buttons

Previous topic - Next topic

erico

Probably a dumb question but I can´t find answers to it around (android extras maybe?).
How do I deal back and menu buttons on android phones using v14 latest?

spacefractal

KEY(1) with back(), alternative use GameInput API().

Menu is not supported at all, but im do pretty sure you manually can check it with a KEY(). Menu() is not important, but Back() is.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

erico

Ok, will look into it soon, thanks.
I just wanted back and menu button not to exit the game right away, similar to your and plow´s games.

By the way, I finally came to use android extras into glb14 and it rocks.
Really superb work Space!

MrPlow

SF's Android Extras have been invaluable to me too - Great work Alan!

Erico, Look forward seeing your game on Playstore :)
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

erico

I must re bump this, can anyone point me out into where I can find out how to assign something or disable the back and menu buttons (left and right) on android?
Is it just key(1) for the back button?
How do I at least make the menu button not to exit?

spacefractal

#5
ALLOWESCAPE FALSE

Currectly both menu and back does extractly the same with KEY(1), due gamecontrollers might not have a back button, only a menu button. Im fix that in the next release, so Menu button also will send a KEY(2) stroke (while gamecontrollers will still share Back and Menu buttons as Back).
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

Also

Androidextras

Android.init()
Android.EnableBackButton(FALSE)

:)
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

spacefractal

#7
Those Commands should not been required anymore and I'm integrated it to ALLOWESCAPE, which by default is true.

The command effect both back and menu.....

By default I'm was set it to false, but Gernot asked me to set it to true.

As I'm previous said. This should alleyways set to false on mobiles, while its works as intended on Windows, it's does not on mobile at all. It's only give means on Windows, since you required to manage the Back button in the newer Android. That impossible with ALLOWESCAPE CAPE TRUE.

But in the end, it's pretty easy to workaround it :-).

Its can confuse, but I'm can not change it back due that request.

Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

erico

Totally understandable and the best choice as it seems.
I should integrate it as in latest GLB14 fashion as you said.

Exiting app from the introduction and main menu with back and menu buttons is all fine.
During gameplay, I want them to perform as a pause button and maybe add a (continue/restart/menu) touch buttons.

Thanks for sharing, I shall have something working in a few days.

spacefractal

Back is not pause on Android. From gameplay, it'd should activate menu, and then Eventuelly quit. This is best practical on Android.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

erico

That is more or less what I meant to do.
I want back to get to a pause menu(which I will code) where you can then get to the game menu and quit.

MrPlow

Didn't know about the v14 default :)

I am still on older version, but will try out v14 on a different laptop to make sure I can revert if things go wrong for me.

Comp:
Speccy-48k, Speccy-128k, Amigas, PCs