• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Windows How do I keep objects actively running their code when the game window is not selected?

T

TennoHack

Guest
I'm trying to make my own custom visual key presser app because all the ones I could find either suck or are pay to use or just aren't customizable enough. And it's really easy, except that it doesn't work when the window isn't actively selected... which ruins the whole point. In the debug console it's saying "Pause event has been triggered for this frame" followed quickly by "Pause event has been unregistered", which I believe is the thing that is making this happen.

How do I stop this from happening? How do I make the game continue to run when it's not actively selected? Will it still keypresses that occur when the window is not selected? If not, how can I get it too?

SOLUTION EDIT: I found a function that gets triggered when you press keys even if the window isn't selected, which solves all my problems, i assume there's a version for mouse as well.
keyboard_check_direct()
 
Last edited by a moderator:

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
SOLUTION EDIT: I found a function that gets triggered when you press keys even if the window isn't selected, which solves all my problems, i assume there's a version for mouse as well.
keyboard_check_direct()
First few indexes are taken up for mouse buttons.
 
Top