Cannot ignore KEY_LWIN and KEY_RWIN

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
ibax
Posts: 193
Joined: Thu Jun 21, 2007 8:56 am
Location: hungary
Contact:

Cannot ignore KEY_LWIN and KEY_RWIN

Post by ibax »

Hi,

I set up some event for few key with their EKEY_CODE, and I'm trying to ignore the other keyboard buttons... Unfortunately I cannot ignore the left and right Windows buttons. Each time I press them, my application exists with the following line in the cmd window:

Code: Select all

DIRECT3D9 end scene failed
Other buttons are acting as requested, they are ignored correctly. Do these buttons need some special handling?
ibax
Posts: 193
Joined: Thu Jun 21, 2007 8:56 am
Location: hungary
Contact:

Re: Cannot ignore KEY_LWIN and KEY_RWIN

Post by ibax »

Unfortunately I did not find any solution yet, for disabling the left/right Windows buttons (KEY_LWIN, KEY_RWIN).
Any ideas?
chronologicaldot
Competition winner
Posts: 688
Joined: Mon Sep 10, 2012 8:51 am

Re: Cannot ignore KEY_LWIN and KEY_RWIN

Post by chronologicaldot »

Just as a first check, make sure you're OnEvent() function returns "false" by default. I'd have to look more at the key files to see what is going on. If you have the sources, look through the file CIrrDeviceWin32, specifically starting on line 764. It may be that those keys are still passed on to the system. idk. Or it could be something else in your program. The Windows buttons don't crash for me, but I use Burnings and OpenGL.
ibax
Posts: 193
Joined: Thu Jun 21, 2007 8:56 am
Location: hungary
Contact:

Re: Cannot ignore KEY_LWIN and KEY_RWIN

Post by ibax »

chronologicaldot wrote:The Windows buttons don't crash for me, but I use Burnings and OpenGL.
Hi. There is no crash. But in my fullscreen-application it interacts with my program -> the start menu appears. Every other not-used buttons are ignored. Nothing happens when I push them. Event checking is passed only to WSA buttons currently.
But unfortunately the left and right WIN keys are also working... I would like to prevent this.
chronologicaldot
Competition winner
Posts: 688
Joined: Mon Sep 10, 2012 8:51 am

Re: Cannot ignore KEY_LWIN and KEY_RWIN

Post by chronologicaldot »

I see, and you're right - the Windows Start menu does open. Well, I don't think either key can be captured. They are akin to the PrtScr (Print Screen) key - the event WILL pass through your software regardless of your efforts to stop it.

I'm not sure precisely what you're doing, but you could try calling the IVideoDriver::endScene() function whenever those buttons are pressed to ensure the scene does end properly. That's my guess.
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: Cannot ignore KEY_LWIN and KEY_RWIN

Post by mongoose7 »

What about http://stackoverflow.com/questions/7675 ... -sharp-wpf? Not C++, but it's a start. (Of no interest to me.)
kh_
Posts: 78
Joined: Fri May 19, 2006 4:29 pm

Re: Cannot ignore KEY_LWIN and KEY_RWIN

Post by kh_ »

direct x doesn't like losing focus in full screen. If it only happens in full screen,most likely your problem.
One solution is a borderless window that fits the screen.

http://www.codesampler.com/dx9src/dx9src_6.htm

http://www.gamedev.net/topic/649889-dir ... st-device/

https://msdn.microsoft.com/en-us/librar ... 85%29.aspx
Post Reply