Add hint SDL_HINT_MOUSE_TOUCH_EVENTS for mouse events to generate touch events

controlling whether mouse events should generate synthetic touch events
By default SDL will *not* generate touch events for mouse events
This commit is contained in:
Sylvain Becker 2019-04-04 16:51:50 +02:00
parent d16648f8ce
commit 1d1eceb6ab
5 changed files with 91 additions and 22 deletions

View file

@ -315,6 +315,18 @@ extern "C" {
*/
#define SDL_HINT_TOUCH_MOUSE_EVENTS "SDL_TOUCH_MOUSE_EVENTS"
/**
* \brief A variable controlling whether mouse events should generate synthetic touch events
*
* This variable can be set to the following values:
* "0" - Mouse events will not generate touch events
* "1" - Mouse events will generate touch events
*
* By default SDL will *not* generate touch events for mouse events
*/
#define SDL_HINT_MOUSE_TOUCH_EVENTS "SDL_MOUSE_TOUCH_EVENTS"
/**
* \brief Minimize your SDL_Window if it loses key focus when in fullscreen mode. Defaults to true.
*

View file

@ -60,6 +60,9 @@ typedef struct SDL_Finger
/* Used as the device ID for mouse events simulated with touch input */
#define SDL_TOUCH_MOUSEID ((Uint32)-1)
/* Used as the SDL_TouchID for touch events simulated with mouse input */
#define SDL_MOUSE_TOUCHID ((Sint64)-1)
/* Function prototypes */