I'm using left and right on the keyboard to move back and forward in my project. For this build, I would like to disable access to the quick menu via arrow keys, primarily so that the quick menu won't be focused by accident, which would make the user have to click more than once in order to advance. How should I do that? I've been browsing the scripts, and all of relevance I've found so far are key bindings and the text that controls which functions appear in the quick menu.
* (A better system that allows the user to switch between forward/back mode and quick menu mode is planned for later, but I'm making a demo, and there would be no need to have quick access for configurations/saves anyway, so for now I'd just prefer to limit the access for simplicity.)
How do I disable key focusing on quick menu?
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.
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.
Re: How do I disable key focusing on quick menu?
Check out this page: https://www.renpy.org/doc/html/keymap.html
There's an example of how to add and remove keys to an event, but let us know if you get stuck
There's an example of how to add and remove keys to an event, but let us know if you get stuck
- Remix
- Eileen-Class Veteran
- Posts: 1628
- Joined: Tue May 30, 2017 6:10 am
- Completed: None... yet (as I'm still looking for an artist)
- Projects: An un-named anime based trainer game
- Contact:
Re: How do I disable key focusing on quick menu?
Find the screen in screens.rpy and amend the buttons to include the attribute:
keyboard_focus - False
It also might be possible (and easier) to add it to the quick_button style
keyboard_focus - False
Code: Select all
textbutton _("Q.Save") action QuickSave() keyboard_focus False
Frameworks & Scriptlets:
- Speech Bubble dialogue system
- Multiple Notify with ATL and history
- (WIP) Radial Masking - needs updating to use Shader
- 7.4 - Smooth Tinting using ATL and matrixcolor
- Several other repositories there too
Re: How do I disable key focusing on quick menu?
Thank you both!
kivk: I went with
for all directions, and that seems to work well, though it would be even better if I could still allow the movement in the main menu.
Remix: I tried that method. It works almost, but not quite. It looks like it prevents individual buttons from being selectable among one another, but it doesn't prevent the quick menu itself from being selected, so the leftmost button could still be focused (at least that's how it seems when I tried with different numbers of buttons and the style method).
kivk: I went with
Code: Select all
$config.keymap['focus_up'].remove('K_UP')
$config.keymap['focus_up'].remove('repeat_K_UP')
Remix: I tried that method. It works almost, but not quite. It looks like it prevents individual buttons from being selectable among one another, but it doesn't prevent the quick menu itself from being selected, so the leftmost button could still be focused (at least that's how it seems when I tried with different numbers of buttons and the style method).
- PyTom
- Ren'Py Creator
- Posts: 16088
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: How do I disable key focusing on quick menu?
For the record; don't do this. The keyboard is necessary for accessibility for players that can't reliably use a mouse.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot]