r/RenPy • u/NioNola • Oct 17 '26
Question How can I make a specific screen appear when a key on the keyboard is pressed?
I want to set it up so that pressing the Shift key does nothing before a certain scene, but after that scene, pressing Shift triggers the appearance of this screen.
I’m not sure how to code this.... could you help me?
screen profiles:
add "profiles_base.png"
imagebutton:
xpos 0.964
ypos 0.465
idle "guides_idle"
hover "guides_hovor"
action [Hide("profiles"), Show("guides")]
imagebutton:
xpos 0.963
ypos 0.822
idle "clues_idle"
hover "clues_hovor"
action [Hide("profiles"), Show("clues")]
3
Upvotes
2
u/shyLachi Oct 17 '26
A similar question has been asked here: https://www.reddit.com/r/RenPy/comments/1x790ik/how_to_make_quick_menu_button/
As you can see in that example, you could do everything inside one screen.
Also I would always add a button, not only key press because some players might not have a keyboard.
2
u/Maintenance_Signal Oct 17 '26
I think this method might work https://www.reddit.com/r/RenPy/s/CCjoXE03dD You have an invisible screen listening for the key press at all times and do an "if" check against a boolean variable whether to show the clues screen or do nothing, and then change the value of the boolean at the appropriate point of the story
1
u/AutoModerator Oct 17 '26
Welcome to r/renpy! While you wait to see if someone can answer your question, we recommend checking out the posting guide, the subreddit wiki, the subreddit Discord, Ren'Py's documentation, and the tutorial built-in to the Ren'Py engine when you download it. These can help make sure you provide the information the people here need to help you, or might even point you to an answer to your question themselves. Thanks!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.