SDL_HINT_MOUSE_TOUCH_EVENTS(3)

πŸ’– SDL_HINT_MOUSE_TOUCH_EVENTS πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where today's main character is literally called SDL_HINT_MOUSE_TOUCH_EVENTS and she is here to answer one very important question: should your mouse be out here pretending to be a finger?? 🫢


✨ NAME ✨

SDL_HINT_MOUSE_TOUCH_EVENTS β€” a variable controlling whether mouse events should generate synthetic touch events. yes fr fr, your mouse can catfish as a touchscreen. it's giving shapeshifter πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3/SDL_hints.h>

#define SDL_HINT_MOUSE_TOUCH_EVENTS "SDL_MOUSE_TOUCH_EVENTS"

that's it. that's the whole vibe. one include, one #define, zero drama. ✨


🌸 DESCRIPTION 🌸

so the variable can be set to the following values, and ngl there are exactly two of them, so this is a quick little vibe check:

  • "0" β€” mouse events will not generate touch events. (this is the default for desktop platforms, so like, your laptop is sitting there like "I'm a mouse and I'm proud of it" πŸ–±οΈ)
  • "1" β€” mouse events will generate touch events. (this is the default for mobile platforms, such as Android and iOS, because bestie, over there the finger is the whole personality πŸ“±πŸ‘†)
lowkey the most important thing: this hint can be set anytime. no "set it before init or else" nonsense, no cursed timing rules, just set it whenever and go. iconic behaviour tbh 😭

🌈 AVAILABILITY 🌈

this hint is available since SDL 3.2.0. so if you're on anything older, she does not exist yet and you are on your own, bestie πŸ’€


and that's the whole page!! every flag, every default, every platform named, no skips, no gatekeeping 🧚

this adorable little slice of documentation came to you from Simple Directmedia Layer, version SDL 3.4.18, and yes it's the SDL_HINT_MOUSE_TOUCH_EVENTS(3) page, mwah πŸ’–

stay hydrated, set your hints, and remember: your mouse does not have to be a finger unless you say so. periodt. πŸ’…πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from