imilne Wrote:Yep, I was returning true. sub, what you say makes sense, but PLAYBACK_KEYDOWN was only intercepted in one place. If anything, now that you mention that, I'd have expected the first screen to open on F5, and then the first screen again from a subsequent F5 because PLAYBACK_KEYDOWN is still catching it.
I've attached a stripped to the bone copy of the source if you want to take a look. MediaInfoPlugin is the control class that handles PLAYBACK_KEYDOWN and then the other two classes are the actual screens.
Thinking about it some more, I'll probably try to handle everything in PLAYBACK_KEYDOWN seeing as it catches everything, rather than have one of the screens try to do OnKeyDown too. At least its behaviour is not what you expect so I feel more confident about getting to the bottom of it now. Thanks.
Iain
I took a look at the sample, and the app seems to be behaving the way I'd expect. The PLAYBACK_KEYDOWN event is like a hook that lets a plugin preview any key that is pressed. Regardless of what the plugin does, that key will still be passed on to the active plugin. It just so happened you were activating the OverlayBasic screen in that plugin when the F5 key was pressed, and after the PLAYBACK_KEYDOWN event was finished processing the F5 key was passed to the active screen (now OverlayBasic), where the OverlayBasic screen had logic that would handle the F5 key to switch to the OverlayAdvanced screen.
Personally I'd just put the screen switching logic in the MediaInfoPlugin.Notify() method.
I've found the reason Dispose() is not called when you're calling ActivateScreen() when another screen is already active, and have fixed it for the next release. Deactivate() was being called.
Thanks sub, I think I understand it now that you've explained it (and the vodka is starting to wear off).
I did make a start on using Notify as you suggest but got stumped by the lack of either Dispose or Deactivate. The plan was to detect which screen was active by having them set flags in their Activate/Deactivate methods but I'm still not seeing any evidence of Deactivate getting called; nothing hits the logs when I put logging statements there anyway...
Sub, do you mind explaining in a bit more detail about *when* Deactivate() should get called?
I'm just not seeing it happen at all, other than when one of my screens is opened on top of the other, causing the first one to deactivate. Closing a screen normally or having it time out and close isn't causing the event.