KeyDown Capture Issue

Hey all,

I’m having a problem with a container control recognizing the KeyDown event. The container control has several custom canvases on it. It has a number of other controls as well.

In one mode of operation, it sets it up to allow the user to program some of the features of the window (it’s basically a large remote control). To get out of programming mode, the user hits the escape key. In OS X I seem to always recognize the escape key. In Windows, not so much. If I go into the programming mode and then try to get out of it right away, no key down event is captured either on the container control or at the window level. Nothing. I can hit any key and no capture. If I click on one of the buttons to program it, this opens another window allowing the user to select what they want the button to do. As soon as that window is closed, now KeyDown events are captured. I have no problem at this point.

So something else seems to be receiving the key down events and they are not being passed up to the container control. I haven’t looked at every single control but none of them have keydown events implemented at my level (I’ve actually implemented a couple jus trying to do some detective work).

So what might be grabbing that event? I’ve seen this before and haven’t been able to figure it out either…

Have you tried getting window.focus with a breakpoint to see what control has the focus? Maybe use setFocus on window open to establish the focused control/container.

If you download the windows sdk you’ll get a program in there called inspect.exe (you might have seen some output that I posted from it in my flicker control investigations). With that program you can click an option to track the Caret, in this mode it will show you which control (and window) currently has keyboard focus so you should be able to see it change as you use your program, just don’t forget to refresh it if you have it open while you start your program or you wont see the changes (Action->Refresh, or Ctrl+Shift+5). If you cant figure out where it is, you can click on the option that will put a yellow bounding box around the control. Much fun :slight_smile:

If after all this, the caret is where it’s meant to be and its still not firing, then that is probably a bug.