From b89c920f32ae4e572850adffe82c08a2b584b5c5 Mon Sep 17 00:00:00 2001 From: thefiddler Date: Sat, 10 May 2014 02:12:52 +0200 Subject: [PATCH] [Examples] Test Mouse.SetPosition --- Source/Examples/OpenTK/Test/GameWindowStates.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Source/Examples/OpenTK/Test/GameWindowStates.cs b/Source/Examples/OpenTK/Test/GameWindowStates.cs index f0248f41..f1072fd2 100644 --- a/Source/Examples/OpenTK/Test/GameWindowStates.cs +++ b/Source/Examples/OpenTK/Test/GameWindowStates.cs @@ -139,9 +139,24 @@ namespace Examples.Tests case Key.Comma: TargetRenderFrequency--; break; case Key.Period: TargetRenderFrequency++; break; - case Key.Space: + case Key.Enter: CursorVisible = !CursorVisible; break; + + case Key.C: + if (Cursor == MouseCursor.Default) + Cursor = Pencil; + else if (Cursor == Pencil) + Cursor = MouseCursor.Empty; + else + Cursor = MouseCursor.Default; + break; + + case Key.Space: + Point p = new Point(Width / 2, Height / 2); + p = PointToScreen(p); + OpenTK.Input.Mouse.SetPosition(p.X, p.Y); + break; } if (!keyboard_keys.ContainsKey(e.Key))