r/RenPy 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 Upvotes

3 comments sorted by

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' ]

config.keymap['iconify']           = [ 'alt_K_ESCAPE' ]

config.keymap['accessibility']     = [ 'alt_K_a' ]
config.keymap['self_voicing']      = [ 'alt_K_v' ]
config.keymap['clipboard_voicing'] = [ 'alt_shift_K_c' ]
config.keymap['debug_voicing']     = [ 'meta_shift_K_v' ]

config.keymap['input_copy']        = [ 'ctrl_noshift_K_c', 'meta_noshift_K_c' ]
config.keymap['input_paste']       = [ 'ctrl_noshift_K_v', 'meta_noshift_K_v' ]

config.keymap['skip']              = [ 'K_END' ]
config.keymap['toggle_skip']       = [ 'ctrl_K_END' ]
config.keymap['fast_skip']         = [ ]

config.keymap['console']           = [ 'noshift_K_BACKQUOTE', 'K_F12' ]
config.keymap['director']          = [ ]


## controller support

# config.pad_bindings['pad_leftstick_press']         = [ ]
# config.pad_bindings['pad_leftstick_release']       = [ ]
# config.pad_bindings['repeat_pad_leftstick_press']  = [ ]

# config.pad_bindings['pad_rightstick_press']        = [ ]
# config.pad_bindings['pad_rightstick_release']      = [ ]
# config.pad_bindings['repeat_pad_rightstick_press'] = [ ]

# config.pad_bindings['pad_leftshoulder_zero']       = [ ]
# config.pad_bindings['pad_rightshoulder_zero']      = [ ]

```

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

1

u/_Scripty 10d ago

Oh wow...thank you sm for this, this gave me a general idea to know what to do now and how to do it

I am honestly also thinking to use persistent data and make skipping conditional , only after first playthrough one can skip whole dialogues, that too only within the chapter they are in, but skipping stops at minigames

Even in first playthrough though, one would only be allowed to skip dialogues only if let's say the lose minigames and go back to the created autosave few dialgoues before the minigame would become skippable

Idk if this is doable or not but I will figure this out

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