renpy accessibility keeps popping up

dstarfire

Member
Jul 13, 2017
314
309
Since a month or two ago, most renpy games bring up an accessibility menu any time I hit the 'a' key, even when typing into a text box (e.g. name your character prompt, or for naming a save file). Is there some way I can turn this stupid feature off, or is there some way to stop it from popping up all the time?
 
Last edited:

scrumbles

Engaged Member
Jan 12, 2019
2,274
2,328
Open renpy\common\00keymap.rpy and add a hash symbol (#) at the beginning of:
Code:
        accessibility = [ "K_a" ],
Alternatively you may open the game console and type:
Code:
config.keymap['accessibility'].remove('K_a')
clear_keymap_cache()
or you may create a patch and include it in every game. Create a new text file, copy this content:
Code:
init python:
    config.keymap['accessibility'].remove('K_a')
    renpy.clear_keymap_cache()
save the file as no_accessibility.rpy and move it into the folder named "game".
 

dstarfire

Member
Jul 13, 2017
314
309
Thank you for your help. That stupid "feature" been driving me nuts. Editing the keymap.rpy file worked like a charm.
Unfortunately, creating a no_accessibility.rpy file just produced an error on launch, so I'll just have to do this manually for each game. I double-checked the spacing (which is critical options.rpy) and each line starts with 4 empty spaces. Here's the error I got, if you want to puzzle out what went wrong:

Code:
While running game code:
  File "game/no_accessibility.rpy", line 1, in script
    init python:
  File "game/no_accessibility.rpy", line 2, in <module>
    config.keymap['accessibility'].remove('K_a')
KeyError: u'accessibility'
Again, that's only if you're curious about what went wrong. I'm content with editing the keymap.rpy file for each game.
 

scrumbles

Engaged Member
Jan 12, 2019
2,274
2,328
If I'm not mistaken, the script make the game crash because in 00keymap.rpy the line:
Code:
        accessibility = [ "K_a" ],
has been already commented (with the '#') or removed and "config.array" has no "accessibility" key (anymore).
Partly it is my fault, I should have put the statement in a try...except block.

This is a safer version of the script:
Code:
init python:
    if "accessibility" in config.keymap.keys():
        if "K_a" in config.keymap["accessibility"]:
            config.keymap['accessibility'].remove('K_a')
    renpy.clear_keymap_cache()
 
  • Like
Reactions: dstarfire

dstarfire

Member
Jul 13, 2017
314
309
If I'm not mistaken, the script make the game crash because in 00keymap.rpy the line:
Code:
        accessibility = [ "K_a" ],
has been already commented (with the '#') or removed and "config.array" has no "accessibility" key (anymore).
Partly it is my fault, I should have put the statement in a try...except block.
Yeah, that was the problem, alright. I tried modifying the 00keymap.rpy file in one game, and it worked. So I then tried creating the no_accessibility file in that same game and copied it around. The reason it crashed my other games is that a lot of them don't have the accessibility line in 00keymap.rpy.

Lesson learned: If I'm going to tinker with something I don't fully understand, be methodical about it, and keep track of what you've done. Also, Python uses indents to mark code blocks (if-then, for/while, init, etc.). I didn't see anything in your example to mark the beginning and end of the if statements, (every other language I've seen uses parentheses, brackets, or some other form of punctuation), so I looked up python if statements and for loops.

Thanks again. Not only can I turn off an annoying feature, I can actually understand .rpy files a lot easier now.
 
  • Like
Reactions: scrumbles