keysym & android

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
xavimat
Eileen-Class Veteran
Posts: 1461
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Discord: xavimat
Contact:

keysym & android

#1 Post 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.
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: keysym & android

#2 Post 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.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
xavimat
Eileen-Class Veteran
Posts: 1461
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Discord: xavimat
Contact:

Re: keysym & android

#3 Post 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.
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: keysym & android

#4 Post by Divona »

"K_AC_BACK"? It also list on the keymap as rollback.
http://pygame-sdl2.readthedocs.io/en/latest/#mobile
Completed:
Image

User avatar
xavimat
Eileen-Class Veteran
Posts: 1461
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Discord: xavimat
Contact:

Re: keysym & android

#5 Post 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.
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

Post Reply

Who is online

Users browsing this forum: No registered users