
GameWindow.FocusedChanged should have a bool saying whether we *received* or *lost* focus
Posted Sunday, 20 February, 2011 - 10:56 by logixoul inGameWindow.FocusedChanged provides no info in its EventArgs, which means I need to check this.Focused to know whether I received focus or lost focus. This is inconsistent with other events such as MouseDevice.Move. I think the EventArgs of FocusedChanged should have a "bool GotFocus". Either that, or FocusedChanged should be split into GotFocus and LostFocus.


Comments
Re: GameWindow.FocusedChanged should have a bool saying ...
Why duplicate information that's trivially available already?
Re: GameWindow.FocusedChanged should have a bool saying ...
Well, I think it's .NET convention to put all event-related data in the EventArgs, so it's what I expected when I was coding using GameWindow. If you don't see it that way though, no problem.
Re: GameWindow.FocusedChanged should have a bool saying ...
Actually, I've tried to follow the BCL conventions as far as possible (not 100%, since much of the code was written before I was even aware of them). In the case of FooChanged events, the convention appears to avoid repeating the value of Foo inside the event. For instance Control.ParentChanged:
I don't if there is an official convention for this, but all FooChanged events I've checked seem to conform to this pattern.
Re: GameWindow.FocusedChanged should have a bool saying ...
Yep. You're right.