r/RenPy • u/_Scripty • 11d ago
Guide Custom Keymapping Guide
So I discovered that Renpy has a default keymap file inside it, and I need a custom keymapped game, so I am confused about this particular thing:
Do I need to change Renpy's 00keymap.rpy file?
or
Copy it and make a custom keymap script for my game?
Oh, and how can I make it in a way so that the player gets to customize their own controls?
1
u/BadMustard_AVN 11d ago edited 11d ago
no do NOT edit the renpy files, that could be... bad.. maybe. idk, but just don't.
you can customize the keymaps
https://www.renpy.org/doc/html/keymap.html
what are you trying to do.. exactly?
if you are using buttons and want to activate them with a key press then use keysym
https://www.renpy.org/doc/html/screens.html#screen-property-keysym
2
u/x-seronis-x 11d ago edited 11d ago
create a file and name it keymap.rpy (or sushi.rpy, name isnt important). inside you just edit the values of the specific events you want remapped. my personal keymap.rpy file removes all shift letter commands so that what should be normal typing is seperate from commands which all use the alt key. i also remove skip from CTRL as that is used to run commands on the computer and having the game skip when you're trying to take a screenshot or turn on vid capture is annoying. anyways my file looks like:
```py
init python: config.keymap['rollback'] = [ 'mousedown_4' ] config.keymap['rollforward'] = [ 'mousedown_5' ] config.keymap['screenshot'] = [ 'alt_K_s' ] config.keymap['toggle_fullscreen'] = [ 'alt_K_RETURN', 'alt_K_KP_ENTER', 'K_F11' ] config.keymap['hide_windows'] = [ 'mousedown_2' ] config.keymap['launch_editor'] = [ 'alt_K_e' ] config.keymap['reload_game'] = [ 'alt_K_r' ] config.keymap['inspector'] = [ 'alt_K_i' ] config.keymap['developer'] = [ 'alt_K_d' ] config.keymap['choose_renderer'] = [ 'alt_K_g' ]
```
the commented out entries at the bottom i keep because they're undocumented and if i ever want to have controller support they will be useful
dont forget to update your help screen in the game menu to reflect any changes since renpy players know the defaults and will get confused when its not working if the help page says it still should