Skip to content
Feniks Development
  • Start Here
  • Glossary
  • Tools
  • Resources
  • What’s New
  • About
  • Contact
Toggle the button to expand or collapse the Menu

Engine Override Notes

  1. Home>
  2. Feniks Tools>
  3. Engine Override Notes

Easy Blinking

  • EasyBlink Class
  • EasyBlink Examples

Controller Support Expansion

  • What is the Controller Support Expansion?
  • How do I…? + Common Issues
  • Controller Viewport
  • Controller Bar
  • Virtual Cursor
  • Virtual Keyboard
  • StickEvent
  • KeyController and focused_on
  • FocusDisplayable
  • Remapping Controls
  • Controller and Keyboard Icons
  • Configuration Variables
  • Screen Actions and Values
  • Helper Functions and Classes
  • Engine Override Notes

Sound Disabler and Captions Tool

  • Disabling Sounds and Sound Categorization
View Categories
  • Home
  • Feniks Tools
  • Controller Support Expansion
  • Engine Override Notes

Engine Override Notes

2 min read

As a tool designed to expand on Ren’Py’s existing functionality to add better controller support, sometimes functions and features need to be overwritten to provide a better experience. Where practical, I will endeavour to get these changes into the engine (and in the case of the bugs I discovered, those fixes are incorporated but only in newer engine versions, so they are backported here). In the meantime, my goal is to have a tool override to get that functionality sooner. This article is a brief overview of the engine functionalities which needed to be overwritten rather than built upon, and thus have the potential to be updated in the future.

Pick up the tool from itch.io if you haven’t already:

Contents hide
renpy.display.controller.start
renpy.display.controller.quit
renpy.map_event
GamepadCalibrate
Hide Windows Key Event
renpy.display.controller.event
renpy.display.focus.before_interact

Most of the overwritten content can be found in controller_override.rpy. There are comments denoting where the overwritten code is.

renpy.display.controller.start

This function runs when a new controller is connected. It has been overwritten to support callbacks.

renpy.display.controller.quit

This function runs when a controller is disconnected. It has been overwritten to support callbacks.

renpy.map_event

This function has been overwritten if the user’s version is below 8.3.x, as there was a bug preventing lists of controller events from working. In 8.3.x+ it is untouched.

GamepadCalibrate

This screen action is overwritten to a version which ensures that the custom controller connect/disconnect callbacks (introduced in the start/quit functions earlier) are not called when calibrating the controller.

Hide Windows Key Event

The default Hide Windows event causes focus to be dropped while in menu screens. An additional hide_windows_without_focus_drop function is added to the keymap underlay to avoid this behaviour.

renpy.display.controller.event

This function is called to process and categorize pygame controller events. It has been overwritten to pass along CONTROLLERAXISMOTION events when a stick enters or leaves its dead zone (to enable granular controller stick movement).

renpy.display.focus.before_interact

This function is called before a new focusable element is selected. It is overwritten only if the user’s version is below 8.3.6, as there’s a bug whereby the default_focus displayable gets focus even if it has been explicitly set by the user to be something else.

Updated on February 9, 2025
Helper Functions and Classes

Leave a Reply Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

© Copyright – Feniks with OceanWP
Close Menu