TINI-8/core/input_handler.py
OusmBlueNinja ae733d164a Created Basic Engine
This project is kind of a dead end.
2024-12-23 22:46:16 -06:00

16 lines
385 B
Python

# engine/input_handler.py
import pygame
class InputHandler:
def __init__(self):
self.keys = {}
def process_event(self, event):
if event.type == pygame.KEYDOWN:
self.keys[event.key] = True
elif event.type == pygame.KEYUP:
self.keys[event.key] = False
def is_key_pressed(self, key):
return self.keys.get(key, False)