Tool Ren'Py Ren'Py Keyboard Menu Selection Mod v2.1

parceload

Member
Nov 14, 2017
112
174
Description:
Select menu options with number keys 1 - 9 instead of requiring a mouse click on buttons.

Use case:
  • During an animated H-scene, you're fapping away and using your left hand to hit the spacebar to continue the story/animations. The scene comes to the climax and -- bam, a menu pops up for cum inside/outside. Right at the peak, you have to take your right hand off your wang and move the mouse to click an option .. the characters cum, but you don't .. the moment is ruined. Using this mod you can now just reach up and hit the 1 or 2 number key with your left hand, and finish all over yourself.
  • Accessibility, if you legit have problems operating a mouse, this mod is similar to selecting a button with the arrow keys and clicking with space/enter, and requires fewer button presses.

Notes:
  • Installation: extract zip to root folder of game (next to the exe)
  • Uninstallation: delete the files game/u-keyboard-menu-selection.rpy and game/u-keyboard-menu-selection.rpyc

Screenshot examples of button mapping:
MyNewFamily_vd0VA9KkoQ.png Element174_mDMN8763mj.png SummertimeSaga_AVvCRWt7dT.png TalesFromTheUnendingVoid_tYXvQiVtuD.jpg

Tested games this mod works perfectly on:
You don't have permission to view the spoiler content. Log in or register now.

Bugs:
  • ShaddyMod - recent Shaddy mods have this functionality built in, using both will cause an error
  • Alexandra - Not compatible, game uses a unique screen for each menu
  • Being A DIK – Keyboard selection works, but menus don't show number

Ren'Py Game Devs:
If you want to include this in your game, copy the mod to the top of your choice screen, something like this:
You don't have permission to view the spoiler content. Log in or register now.

Download: (attached)
You don't have permission to view the spoiler content. Log in or register now.
 
Last edited:

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,979
16,236
Games this mod DOESN'T work on / bugs:
  • My Girlfriend's Amnesia Unofficial Ren'py Port -- There are 2 items on the top above the menu, so the first menu button gets mapped to number 3
It will also not works correctly on all games that include disabled choice in the menu ; the choice will be visible, but not take in count in the numbering. Therefore if you've something like :
Code:
    menu:
        "choice 1" if True is False:
            "choice 1"
        "choice 2":
            "choice 2"
        "choice 3":
            "choice 3"
The player will show :
  • choice 1
  • choice 2
  • choice 3
But pressing "1" will trigger the choice 2. It will be even more a problem when using the auto-numbering version of choice screen.

Plus, it don't limit to effective menus. If there's no menu displayed, the keys will trigger the quick menu, or anything else depending of what buttons are shown on the screen.

If someone effectively want to use the keyboard to trigger menu, the arrow keys already permit it, with more accuracy.
 

parceload

Member
Nov 14, 2017
112
174
It will also not works correctly on all games that include disabled choice in the menu ; the choice will be visible, but not take in count in the numbering. Therefore if you've something like :
Code:
    menu:
        "choice 1" if True is False:
            "choice 1"
        "choice 2":
            "choice 2"
        "choice 3":
            "choice 3"
The player will show :
  • choice 1
  • choice 2
  • choice 3
But pressing "1" will trigger the choice 2. It will be even more a problem when using the auto-numbering version of choice screen.
incorrect, in that example, "choice 1" won't be shown to the user, the top option will be "choice 2" (which in games would be a text dialog, not a number), and key number 1 will correctly click it, because it's the first option

Plus, it don't limit to effective menus. If there's no menu displayed, the keys will trigger the quick menu, or anything else depending of what buttons are shown on the screen.

If someone effectively want to use the keyboard to trigger menu, the arrow keys already permit it, with more accuracy.
correct, as I said in the initial post: don't hit a number higher than the number of available choices

if you want code that is "limit to effective menus", I've already included it in the initial post under "Ren'Py Devs" section, but that would have to be released in a per-game way, not a mod that works on nearly everything, which this is

arrow keys:
more accuracy? maybe, in few edge cases
more button presses? always
 
Last edited:

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,979
16,236
incorrect, in that example, "choice 1" won't be shown to the user, the top option will be "choice 2" [...]
As I said, this apply for games that include disabled choice in the menu. So, the fact that have to be set at True was implicit.


correct, as I said in the initial post: don't hit a number higher than the number of available choices
And you also have to not hit a number when there's no menu displayed on screen. As well as you have to hope that the game itself don't use numbers keys to interact with it's own user interface.


if you want code that is "limit to effective menus", I've already included it in the initial post under "Ren'Py Devs" section, but that would have to be released in a per-game way, not a mod that works on nearly everything, [...]
An alternative directly put in the choice screen can perfectly works as (almost) universal mod. The only effective limitations would be if the menu don't use the said choice screen, or if the said screen have variants ; yet there's workarounds for the second.

Code:
init 1000 python:
    renpy.display.screen.screens[( "OLDchoice", None )] = renpy.display.screen.get_screen_variant( "choice" )
    renpy.display.screen.screens[( "choice", None )] = renpy.display.screen.get_screen_variant( "NEWchoice" )

screen NEWchoice(items):
    [do whatever you want]
    use OLDchoice( items )

screen OLDchoice(items):
    pass
 
  • Like
Reactions: gojira667

parceload

Member
Nov 14, 2017
112
174
An alternative directly put in the choice screen can perfectly works as (almost) universal mod. The only effective limitations would be if the menu don't use the said choice screen, or if the said screen have variants ; yet there's workarounds for the second.
hm! I think I like that, mind if I steal the idea?

You don't have permission to view the spoiler content. Log in or register now.
 
Last edited:

ADevCalledQuest

New Member
Mar 22, 2023
12
4
Interesting code - I had never really considered how big of an inconvenience not being able to progress through a CG left-handed was, but now that I realize it, it's really problematic in a *lot* of games. I'll be implementing this into mine in the future.
 
  • Like
Reactions: parceload

Yasudoloko

New Member
Jul 26, 2022
10
4
what if a game doesn't have textbox or options on the bottom to back, auto, save, etc. what button is used for the auto and back on the keyboard? or is that not a thing