deactivating kb when window deactivated
when i switch to another program, say, winamp, and my program is running, the arrow keys would affect both the winamp bar, AND my program inputs. how do i prevent this? (how do i deactivated the keyboard for the inactive window?)
a2k
Well, DirectInput checks the keyboard scan codes, so you can do two things that I know of:
Either shut down DirectInput and bring it back up when the program is re-activated (stupid idea, IMHO, too much work).
What would be better, is to just not read the keyboard when you''re minimized. Look into handling the WM_ACTIVATEAPP windows message so your program doesn''t do anything when minimized. Kinda like pausing it, and not checking input until it''s reactivated.
I hope this is what you needed.
Either shut down DirectInput and bring it back up when the program is re-activated (stupid idea, IMHO, too much work).
What would be better, is to just not read the keyboard when you''re minimized. Look into handling the WM_ACTIVATEAPP windows message so your program doesn''t do anything when minimized. Kinda like pausing it, and not checking input until it''s reactivated.
I hope this is what you needed.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement