Inputs

Games are interactive by nature, so handling player input is essential. Flame provides input handling that works on all platforms Flutter supports: touch on mobile, mouse and keyboard on desktop, and pointer events on the web. These APIs are designed as mixins that you add to your components, so each component can independently decide which input events it cares about. This is similar to how Flutter’s GestureDetector works, but adapted for Flame’s component tree.