SDL_HINT_TOUCH_MOUSE_EVENTS(3)

πŸ’– SDL_HINT_TOUCH_MOUSE_EVENTS πŸ’–

okay bestie, so this is a page from the SDL3 FUNCTIONS manual, and it's literally all about one lil' hint variable. she's small, she's mighty, she's SDL_HINT_TOUCH_MOUSE_EVENTS. no cap. 🫢


✨ NAME ✨

SDL_HINT_TOUCH_MOUSE_EVENTS β€” a variable controlling whether touch events should generate synthetic mouse events.

like... when you tap the screen, should SDL be like "omg that's also a mouse click, bestie πŸ’…"? that's the whole question this hint answers.


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_hints.h>

#define SDL_HINT_TOUCH_MOUSE_EVENTS "SDL_TOUCH_MOUSE_EVENTS"

so you pull in SDL_hints.h and there's the macro, holding the string "SDL_TOUCH_MOUSE_EVENTS". copy that string character for character, bestie, do not freestyle it. πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

the variable can be set to the following values, and there are literally only two, so this is not a vibe-check situation, it's a two-option situation:

  • "0" β€” touch events will NOT generate mouse events. no synthetic mouse energy whatsoever. the touch stays a touch. periodt.
  • "1" β€” touch events WILL generate mouse events. this one is the default, so if you don't touch the hint (lol) you're getting mouse events out of your taps.

this hint can be set anytime. not "at init", not "before the window opens" β€” anytime. iconic behaviour honestly. ✨


🌈 AVAILABILITY 🌈

this hint has been around since SDL 3.2.0. so if you're on something older than that... it's giving "not for you", sorry babe 😭


heads up: if you set it to "0" and then wonder why your taps aren't clicking anything, that's not a bug, that's you, bestie. πŸ’€

and that's the whole page!! mwah πŸ’– sending you off with the source deets: this is the Simple Directmedia Layer manual, SDL 3.4.18, page SDL_HINT_TOUCH_MOUSE_EVENTS(3). go forth and touch (or don't touch) things. slay πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from