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
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms