From a430319c43219868827ec21b40eb0076af6b58a5 Mon Sep 17 00:00:00 2001 From: LaurentGom Date: Fri, 17 Jul 2009 08:01:57 +0000 Subject: [PATCH] Removed the Window.Events property in SFML.Net FS#124 - Fix KeyEvent.Alt/Control/Shift members not working, in SFML.Net git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/trunk@1180 4e206d99-4929-0410-ac5d-dfc041789085 --- dotnet/src/Window/Event.cs | 6 +++--- dotnet/src/Window/EventArgs.cs | 6 +++--- dotnet/src/Window/Window.cs | 22 ++-------------------- 3 files changed, 8 insertions(+), 26 deletions(-) diff --git a/dotnet/src/Window/Event.cs b/dotnet/src/Window/Event.cs index 37a1043f..543ada66 100644 --- a/dotnet/src/Window/Event.cs +++ b/dotnet/src/Window/Event.cs @@ -234,13 +234,13 @@ namespace SFML public KeyCode Code; /// Is the Alt modifier pressed? - public bool Alt; + public int Alt; /// Is the Control modifier pressed? - public bool Control; + public int Control; /// Is the Shift modifier pressed? - public bool Shift; + public int Shift; } //////////////////////////////////////////////////////////// diff --git a/dotnet/src/Window/EventArgs.cs b/dotnet/src/Window/EventArgs.cs index 89c47744..d66e569c 100644 --- a/dotnet/src/Window/EventArgs.cs +++ b/dotnet/src/Window/EventArgs.cs @@ -20,9 +20,9 @@ namespace SFML public KeyEventArgs(KeyEvent e) { Code = e.Code; - Alt = e.Alt; - Control = e.Control; - Shift = e.Shift; + Alt = e.Alt != 0; + Control = e.Control != 0; + Shift = e.Shift != 0; } /// Code of the key (see KeyCode enum) diff --git a/dotnet/src/Window/Window.cs b/dotnet/src/Window/Window.cs index 51041e9b..c2f74196 100644 --- a/dotnet/src/Window/Window.cs +++ b/dotnet/src/Window/Window.cs @@ -103,25 +103,6 @@ namespace SFML myInput = new Input(sfWindow_GetInput(This)); } - //////////////////////////////////////////////////////////// - /// - /// Return the list of window's events which happened since last call - /// - /// Array of events - //////////////////////////////////////////////////////////// - public Event[] Events - { - get - { - Event Evt; - List Evts = new List(); - while (GetEvent(out Evt)) - Evts.Add(Evt); - - return Evts.ToArray(); - } - } - //////////////////////////////////////////////////////////// /// /// Input manager of the window @@ -365,7 +346,8 @@ namespace SFML //////////////////////////////////////////////////////////// public void DispatchEvents() { - foreach (Event e in Events) + Event e; + while (GetEvent(out e)) { switch (e.Type) {