Hard back buttons in Android

Found a bug in R'n'D? Report it here!

Moderators: Flumminator, Zomis

Post Reply
MichaelCPalmer1980
Posts: 8
Joined: Thu Nov 02, 2017 10:11 am

Hard back buttons in Android

Post by MichaelCPalmer1980 »

Running Android 6.0 on an RCA Viking Pro 10.1 I have found the following bug.

Using the on screen back button works as expected.

Pressing the back button on my keyboard immediately exits the game without requesting confirmation first.

Regards,
Michael
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Hard back buttons in Android

Post by Holger »

Oh well, this sounds like a program crash for whatever reason! :-(

Does the back button on your keyboard work as it should in other Android applications? Or does it behave differently in any way in comparison to the screen's back button in other apps?

I'm afraid that I would have to run R'n'D in debug mode with console output to see if it's crashing or what else is happening in that case... :-o

Are you familiar with running Android apps using the ADB (Android Debug Bridge) to have a look at the logs to see what's going on?

Has anybody else encountered similar behaviour (crashes) with the Android version when using an external (physical) keyboard with Android devices? If so, I could buy a cheap Android keyboard to try to reproduce (and debug) the behaviour by myself...
filbo
Posts: 647
Joined: Fri Jun 20, 2014 10:06 am

Re: Hard back buttons in Android

Post by filbo »

The image posted in that other thread gave a path to stderr.txt -- would looking at the contents of that path be of any help, without going to the effort of setting up ADB etc. ?
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Hard back buttons in Android

Post by Holger »

Yes, having a look at R'n'D's error logfile (which is a bit hidden on Android, I'm afraid) would be worth a try!
MichaelCPalmer1980
Posts: 8
Joined: Thu Nov 02, 2017 10:11 am

Re: Hard back buttons in Android

Post by MichaelCPalmer1980 »

Ì haven't had any other problems with the keyboard's back button in other apps or games, including my own games. In RFO Basic, which I develop my games in, there is absolutely no difference between the keyboard and on-screen back button, but in some Linux ports, such as AndrOpen office, the keyboard back button works as an escape key.

I have no evidence that the game is crashing, nor a PC or other device to test it. I use a keyboard remapper called "External Keyboard helper" to remap the alt-grab as a delete key and a few other things. While reading your reply I considered using it to see what keycode the back button sends but realized maybe it's the source of my problem. I will experiment with that and see if "Terminal IDE" lets me view stdout. Ii's and android app that grants access to the linux CLI and the gcc tools.

Will let you kow soon
thanks
MichaelCPalmer1980
Posts: 8
Joined: Thu Nov 02, 2017 10:11 am

Re: Hard back buttons in Android

Post by MichaelCPalmer1980 »

I disabled Extended Keyboard Helper and the problem went away. The utility never caused issues with any other apps so I never even considered its being the source. I will fool around with some of its options and see if I can eliminate the problem, otherwise I'll try remembering to switch back to the google keyboard input method before playing because that's all it takes for the back button to behave itself.

I found stderr.txt and stdout.txt at /Android/data/org.artsoft/rocksndiamonds/files/, but they're both empty. I checked before, during, and after RnD execution, but although the files are accessed, they do not change. They remain 0-byte files.
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Hard back buttons in Android

Post by Holger »

Just found the following in the SDL 2.0.9 pre-release announcement:
Added the hint SDL_HINT_ANDROID_TRAP_BACK_BUTTON to control whether the back button will back out of the app (the default) or be passed to the application as SDL_SCANCODE_AC_BACK
Added SDL_AndroidBackButton() to trigger the Android system back button behavior when handling the back button in the application
This sounds a bit strange to me, as if "backing out of the app" (which sounds to me like pressing the "home" button rather than the "back" button) could be anything other than unwanted behaviour if pressing the "back" button on Android! :shock:

I haven't tested this pre-release so far, but I wonder if it could have anything to do with the problem you described.
Post Reply