No, it's not possible through regular means.
(Edit: It's not completely impossible, but achieving it requires os-specific lower level workarounds)
Last edited by zorg on Tue Sep 17, 2019 5:07 am, edited 1 time in total.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
SDL is a gaming-centric framework and games are not meant to capture input while in background. Implementation-wise, SDL polls input from a window, if it loses focus then there's no input events.
The whole concept of focus is about where to send input events, isn't it?
Imagine you are typing in an editor, then change window to a web form, and what you type in the web form is typed in the editor. [EDIT: Or that you press F1 for help in one application, and every other open application opens the help.]
It is possible for certain applications to receive certain inputs when not focused, for example a music player in the background can receive multimedia keys, but as raidho implied, SDL is not prepared for that.
Last edited by pgimeno on Tue Sep 17, 2019 11:41 am, edited 1 time in total.
I faintly remember someone saying that you can still detect joystick/gamepad stuff even when unfocused though, if not keyboard/mouse.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.