SDL_HINT_TRA...IS_TOUCH_ONLY(3)
π SDL_HINT_TRACKPAD_IS_TOUCH_ONLY π
okay bestie, welcome to SDL_HINT_TRACKPAD_IS_TOUCH_ONLY(3) β yes that's the manual page name, it's giving long and dramatic but I promise it's a whole vibe once you get in. this is one of the SDL3 function/hint pages, and it's literally about whether your trackpad is a mouse or a whole touch device. the way that one little variable decides so much?? iconic.
β¨ NAME β¨
SDL_HINT_TRACKPAD_IS_TOUCH_ONLY β a variable controlling whether trackpads should be treated as touch devices.
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_hints.h>
#define SDL_HINT_TRACKPAD_IS_TOUCH_ONLY "SDL_TRACKPAD_IS_TOUCH_ONLY"
like, that's the include, that's the define, that's the whole entry point. slay.
π¦ DESCRIPTION π¦
so here's the tea, bestie π: on macOS (and possibly other platforms in the future, they're keeping their options open, main character energy), SDL will report touches on a trackpad as mouse input. and honestly? that's generally what users expect from this device. it's the normal, default, nobody-bats-an-eye behaviour.
BUT β and this is the plot twist π β those trackpads are often actually full multitouch-capable touch devices. like, they were touch devices the whole time and we were just calling them mice. so for some apps, it might be preferable to treat them as such. and that's exactly what this hint lets you do. π«Ά
the variable can be set to the following values:
"0"β Trackpad will send mouse events. (this is the default, it's the chill one)"1"β Trackpad will send touch events. (the spicy one, multitouch mode activated β¨)
β οΈ okay so important: this hint should be set before SDL is initialized. like, before. set it early or it won't hit the same, fr fr.
π AVAILABILITY π
this hint is available since SDL 3.2.0. so if you're on anything older... bestie, upgrade. π
π one last thing π
this page came to you from Simple Directmedia Layer, riding with SDL 3.4.18. that's the source and the version, right there, no cap. now go set your hint before SDL_Init and live your best multitouch life. bye bestie, love u, don't forget to check the other hints pages ππ¦β¨
π¦ 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