From 4099b6f72e03bb0be41908a339c625b009af58e1 Mon Sep 17 00:00:00 2001 From: Matteo Benedetto Date: Tue, 19 Aug 2025 16:37:04 +0200 Subject: [PATCH] Add joystick hat motion handling in KeyLogger --- key.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/key.py b/key.py index 4782ca4..19740a5 100644 --- a/key.py +++ b/key.py @@ -48,6 +48,10 @@ class KeyLogger: axis = event.jaxis.axis value = event.jaxis.value self.message = f"Joystick axis {axis} moved to {value}" + elif event.type == sdl2.SDL_JOYHATMOTION: + hat = event.jhat.hat + value = event.jhat.value + self.message = f"Joystick hat {hat} moved to {value}" elif event.type == sdl2.SDL_QUIT: self.running = False