How to disable screenshots & GIF recordings in raylib
I’m trying to disable two small things in raylib: the screenshot shortcut (F12) and the GIF recording shortcut (CTRL+F12). I don’t need them, and I don’t want end users to trigger them accidentally and get confused.
My project pulls raylib in through CMake’s FetchContent:

I assume I can just turn off the features with two flags:

I rebuild, run the program, press F12 and it still takes a screenshot.
- I delete the build folder and try again. Still there.
- I assume FetchContent isn’t propagating the options correctly, so I clone raylib directly and build it from source. Still doesn’t work.
- I try making a static library and linking it manually. Same result.
At this point, I’m knee-deep in CMake files, flipping random flags like a madman. Eventually, I stumble across something called CUSTOMIZE_BUILD buried in raylib’s build scripts and that’s when it clicks.
Raylib’s configuration system hides all its internal feature flags behind that one variable. Unless CUSTOMIZE_BUILD is enabled, any attempt to set SUPPORT_SCREEN_CAPTURE or SUPPORT_GIF_RECORDING is silently ignored.
The fix ends up being disappointingly simple:

I rebuild, run it again, and finally: F12 does nothing.
It’s the kind of thing that’s easy to miss, and I can’t seem to find anything about it online. So if you ever wonder why your raylib flags don’t work, now you know.
Member discussion