Keys pressed when window not focused?

How can I make it so for example when I press the p key it does an action like fullscreen the window but when the window is not selected?

As far as I know, the engine cannot track actions outside of when it is the focused window.

Through this action? Haven’t tried it tbh.

k thank you!

(this is here bc it has to be 20 characters)