From 6864127ea0fadb437726ad8ae35436f6fb2c1609 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Sun, 4 May 2008 14:45:33 +0000 Subject: [PATCH] Fixed Alt+Enter fullscreen toggling. --- Source/Examples/Tutorial/T01_Simple_Window.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Source/Examples/Tutorial/T01_Simple_Window.cs b/Source/Examples/Tutorial/T01_Simple_Window.cs index 61abe5a6..0015fdfa 100644 --- a/Source/Examples/Tutorial/T01_Simple_Window.cs +++ b/Source/Examples/Tutorial/T01_Simple_Window.cs @@ -38,13 +38,14 @@ namespace Examples.Tutorial /// The key that was pressed. void Keyboard_KeyDown(KeyboardDevice sender, Key key) { - if (WindowState != WindowState.Fullscreen) - WindowState = WindowState.Fullscreen; - else - WindowState = WindowState.Normal; - if (sender[Key.Escape]) 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