Hi. I have a problem and was wondering if anyone could help.
I made custom FPS control for my game. (Please do not comment on that. I wanted and I did it. Its not the case here.)
I have a function game_wait() that does some events I desire and then run sleep() until the end of a frame.
The only problem with it is that the game no longer handles window events (Esc, closing, alt+F4, etc.) as my game runs my function in a loop.
I could of course just add to my function checking for all the important combinations e.g. "if (keyboard_check(vk_alt) && keyboard_check(vk_f4) ) game_end();" but I was hoping for a different automatic way.
Is there anything I can do to tell the game to run window events itself e.g. with a single call of built-in function? Maybe with a DLL? Anyone got any idea?
Handling Window Events With Custom Fps Control
Started by Dark Exiler, Mar 05 2010 12:51 PM
4 replies to this topic
#1
Posted 05 March 2010 - 12:51 PM
#2
Posted 05 March 2010 - 02:34 PM
Execute io_handle() once per loop.
#3
Posted 05 March 2010 - 04:51 PM
GM help says io_handle() only updates the status from mouse and keyboard and it really seems to do just that.
That wasnt my problem. I know how to write a GML code to handle window events and make it work.
What Im looking for is function (or something) that will handle everything without me having to specify exact key combinations and checks.
That wasnt my problem. I know how to write a GML code to handle window events and make it work.
What Im looking for is function (or something) that will handle everything without me having to specify exact key combinations and checks.
#4
Posted 05 March 2010 - 07:05 PM
Well, you'll just have to code them all yourself then.
There is no built-in gm function for that.
I'm sure someone could create some dll to hack into the runner and reroute io_handle to also handle those keys, but that's a lot of effort, for something that's easy to do.
There is no built-in gm function for that.
I'm sure someone could create some dll to hack into the runner and reroute io_handle to also handle those keys, but that's a lot of effort, for something that's easy to do.
#5
Posted 05 March 2010 - 07:52 PM
I guess...
Im just a little worried coding it myself.
Im not sure if I remember right but wasnt there some way to disable key combinations for applications in Windows?
Id just feel safer using default window handling call rather than hard coding it in my game.
Im just a little worried coding it myself.
Im not sure if I remember right but wasnt there some way to disable key combinations for applications in Windows?
Id just feel safer using default window handling call rather than hard coding it in my game.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











