Page 1 of 1

keysym & android

Posted: Wed Nov 08, 2017 12:37 pm
by xavimat
I'm trying to understand how to use the back button on android in a custom screen.
The Launcher emulator says "PageUp is mapped to the back button". That means, when emulating, the PageUp key of my keyboard acts as the back button of an android device.

My question is, is that also correct on reverse?
If I make a button in a screen with keysym "K_PAGEUP", will the action of this button be executed when the back button on android is pressed?
The use case is an informative screen that pops-up in modal mode. It has a "Close" button, but it would be nice if also the back button closes it.

Re: keysym & android

Posted: Wed Nov 08, 2017 4:36 pm
by Imperf3kt
Not sure if this helps or not, but in my android tutorial (wip), the back button acts as rollback.

I beleive page up is only for the emulator, and not true of the reverse.

Re: keysym & android

Posted: Wed Nov 08, 2017 7:33 pm
by xavimat
Thanks, imperf3kt.
Yes, the doc says thay the back button on android does the rollback , but in a custom screen, when it's called, "rollback" means nothing. (In fact, the left arrow used in the pc keyboard for rollback, does not "roll back" a called screen, but moves focus among buttons of the screen). So, I'm wondering how to manually assign the backbutton on android to a button.

Re: keysym & android

Posted: Wed Nov 08, 2017 11:52 pm
by Divona
"K_AC_BACK"? It also list on the keymap as rollback.
http://pygame-sdl2.readthedocs.io/en/latest/#mobile

Re: keysym & android

Posted: Thu Nov 09, 2017 6:14 am
by xavimat
Thanks Divona. I didn't know that doc.
I'll try if it works also using keysym in a button and report back here.