How to disable all control?

I’m kind of new to Lua and want to know, how to disable all controls, while a menu is opened.
Just something with the logic of “if the menu is opened, disable all controls, except those of the menu”

Thank you for your help!

Hello,

You can use: https://runtime.fivem.net/doc/natives/#0x5F4B6931816E599B
and use IS_DISABLED_CONTROL
* natives to use “disabled controls” in your menu