pen: Send virtual mouse and touch events for pen input.

Fixes #11948.
This commit is contained in:
Ryan C. Gordon
2025-01-14 23:30:10 -05:00
parent 169c8d5140
commit dabc93a631
8 changed files with 168 additions and 32 deletions

View File

@@ -40,6 +40,8 @@
#define SDL_pen_h_
#include <SDL3/SDL_stdinc.h>
#include <SDL3/SDL_mouse.h>
#include <SDL3/SDL_touch.h>
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
@@ -59,6 +61,20 @@ extern "C" {
*/
typedef Uint32 SDL_PenID;
/**
* The SDL_MouseID for mouse events simulated with pen input.
*
* \since This macro is available since SDL 3.1.3.
*/
#define SDL_PEN_MOUSEID ((SDL_MouseID)-2)
/**
* The SDL_TouchID for touch events simulated with pen input.
*
* \since This macro is available since SDL 3.1.3.
*/
#define SDL_PEN_TOUCHID ((SDL_TouchID)-2)
/**
* Pen input flags, as reported by various pen events' `pen_state` field.