Default_focus True + tooltips break keyboard navigation?

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
IcyValet
Newbie
Posts: 11
Joined: Fri Feb 08, 2019 11:13 pm
itch: icyvalet
Contact:

Default_focus True + tooltips break keyboard navigation?

#1 Post by IcyValet » Wed Oct 05, 2022 1:29 am

On Ren'Py version 8.0.3. Maybe related to the recent default_focus changes?

Quick build showing the possible bug:
https://drive.google.com/file/d/1pNyk8z ... sp=sharing

I replaced main menu with this:

Code: Select all

screen main_menu():
    vbox align (0.5,0.5) spacing 10:
        textbutton "This button does not have a tooltip and has default_focus True." background "#FFF" action NullAction() default_focus True
        textbutton "This button does not have a tooltip." background "#FFF" action NullAction() 
        textbutton "This button does not have a tooltip." background "#FFF" action NullAction() 
        textbutton "This button has a tooltip." background "#FFF" action NullAction() tooltip "This is the tooltip."

    $ tooltip = GetTooltip()

    if tooltip:
        label [tooltip]:
            align (0.5,0.8)
            background "#FFF"
The issues:
  • Mouse works fine, but if you navigate with keyboard UP/DOWN, the last button with the tooltip can't gain focus and thus the player can't interact with it.
  • If you move "default_focus True" to the last button with the tooltip, then when you navigate with keyboard to the last button, the focus will stay stuck to that button.
  • If you delete "default_focus True" from the first button, then keyboard works fine on all buttons.
  • If you delete the tooltip from the last button, then keyboard works fine on all buttons.

Post Reply

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot]