[Solved] How to get keyup to work with key? Keydown works though.

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
henvu50
Veteran
Posts: 337
Joined: Wed Aug 22, 2018 1:22 am
Contact:

[Solved] How to get keyup to work with key? Keydown works though.

#1 Post by henvu50 »

EDIT: thanks to renpytom for updated this in the documentation! https://www.renpy.org/doc/html/keymap.html

SOLUTION: the correct syntax is "keyup_K_x" ... example:
"keyup_K_a"
"keyup_K_b"
"keyup_K_c"
"keyup_K_1"
"keyup_K_2"
"keyup_K_3"

For some reason keyup is not working, but keydown works fine. Anyone know how to get the keyup to work? Maybe my syntax is wrong?

Code: Select all

default someVar = False
screen test1():
    key "keydown_x" action SetVariable("someVar", True)  #works
    key "keyup_x" action SetVariable("someVar", False)     #doesn't work
    key "keyup_y" action SetVariable("someVar", False)     #doesn't work
    key "y" action SetVariable("someVar", False)               #works
    text "[someVar]"
label start:
    show screen test1
    "testing"
    return
I tested this with a brand new ren'py project.

Post Reply

Who is online

Users browsing this forum: No registered users