GLBasic forum

Main forum => GLBasic - en => Topic started by: erico on 2016-Apr-24

Title: ANDROID back and menu buttons
Post by: erico on 2016-Apr-24
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?
Title: Re: ANDROID back and menu buttons
Post by: spacefractal on 2016-Apr-24
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.
Title: Re: ANDROID back and menu buttons
Post by: erico on 2016-Apr-26
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!
Title: Re: ANDROID back and menu buttons
Post by: MrPlow on 2016-Apr-28
SF's Android Extras have been invaluable to me too - Great work Alan!

Erico, Look forward seeing your game on Playstore :)
Title: Re: ANDROID back and menu buttons
Post by: erico on 2016-May-30
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?
Title: Re: ANDROID back and menu buttons
Post by: spacefractal on 2016-May-30
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).
Title: Re: ANDROID back and menu buttons
Post by: MrPlow on 2016-May-31
Also

Androidextras

Android.init()
Android.EnableBackButton(FALSE)

:)
Title: Re: ANDROID back and menu buttons
Post by: spacefractal on 2016-May-31
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.

Title: Re: ANDROID back and menu buttons
Post by: erico on 2016-Jun-01
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.
Title: Re: ANDROID back and menu buttons
Post by: spacefractal on 2016-Jun-01
Back is not pause on Android. From gameplay, it'd should activate menu, and then Eventuelly quit. This is best practical on Android.
Title: Re: ANDROID back and menu buttons
Post by: erico on 2016-Jun-01
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.
Title: Re: ANDROID back and menu buttons
Post by: MrPlow on 2016-Jun-01
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.