Fixed Alt+Enter fullscreen toggling.

This commit is contained in:
the_fiddler 2008-05-04 14:45:33 +00:00
parent 49b0c413ca
commit 6864127ea0

View file

@ -38,13 +38,14 @@ namespace Examples.Tutorial
/// <param name="key">The key that was pressed.</param> /// <param name="key">The key that was pressed.</param>
void Keyboard_KeyDown(KeyboardDevice sender, Key key) void Keyboard_KeyDown(KeyboardDevice sender, Key key)
{ {
if (WindowState != WindowState.Fullscreen)
WindowState = WindowState.Fullscreen;
else
WindowState = WindowState.Normal;
if (sender[Key.Escape]) if (sender[Key.Escape])
this.Exit(); this.Exit();
if ((sender[Key.AltLeft] || sender[Key.AltRight]) && (sender[Key.Enter] || sender[Key.KeypadEnter]))
if (this.WindowState == WindowState.Fullscreen)
this.WindowState = WindowState.Normal;
else
this.WindowState = WindowState.Fullscreen;
} }
#endregion #endregion