Alt key

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
tsurugi
Posts: 3
Joined: Sat Oct 24, 2009 12:31 am

Alt key

Post by tsurugi »

Whenever I press the alt key in my game it loses focus because it activates the menu strip at the top (of course it doesn't show it). So is there any way to disable the game from losing focus after pressing the alt key?
someguy99
Posts: 38
Joined: Sun Oct 11, 2009 11:20 am

Post by someguy99 »

tsurugi
Posts: 3
Joined: Sat Oct 24, 2009 12:31 am

Post by tsurugi »

Yeah, except I don't want it to pause, I just don't want the game to lose focus.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Then you have to modify CIrrDeviceWin32.cpp to process the keyboard event and to not pass it on to the default handler. I posted some sample code a while back that shows what you'd need to do. If you use the code as shown, the ALT+F4 key combination will no longer work to close your program. If you want that to work again, you could handle it in an event receiver, or you could make additional changes to allow that specific combination to work.

Travis
Post Reply