shithub: npe

Download patch

ref: 5ac3e2deaaf306980c1c8920382ffa10e30a95b1
parent: f4806ccc1f6ce56cd19aa7c66cf2c322fef9754c
author: Jacob Moody <moody@posixcafe.org>
date: Sun Apr 16 23:02:47 EDT 2023

sdl2: add jhat event

--- a/include/npe/SDL2/SDL_events.h
+++ b/include/npe/SDL2/SDL_events.h
@@ -30,6 +30,7 @@
 	SDL_WINDOWEVENT_LEAVE,
 	SDL_WINDOWEVENT_CLOSE,
 	SDL_JOYBALLMOTION,
+	SDL_JOYHATMOTION,
 
 	SDL_PRESSED = SDL_KEYDOWN,
 	SDL_RELEASED = SDL_KEYUP,
@@ -39,6 +40,16 @@
 	SDL_ADDEVENT = 0,
 	SDL_PEEKEVENT,
 	SDL_GETEVENT,
+
+	SDL_HAT_LEFTUP = 0,
+	SDL_HAT_LEFT,
+	SDL_HAT_LEFTDOWN,
+	SDL_HAT_UP,
+	SDL_HAT_CENTERED,
+	SDL_HAT_DOWN,
+	SDL_HAT_RIGHTUP,
+	SDL_HAT_RIGHT,
+	SDL_HAT_RIGHTDOWN,
 };
 
 typedef struct SDL_WindowEvent SDL_WindowEvent;
@@ -109,6 +120,10 @@
 		int xrel;
 		int yrel;
 	}jball;
+	struct {
+		int hat;
+		int value;
+	}jhat;
 	struct {
 		int x, y;
 		int xrel, yrel;