From e36a0d0fbcdea0142dbaafea2878cd21cc8282bb Mon Sep 17 00:00:00 2001 From: thefiddler Date: Fri, 25 Apr 2014 13:38:53 +0200 Subject: [PATCH] [OpenTK] Rebased on develop --- Source/OpenTK/Platform/MacOS/CocoaNativeWindow.cs | 9 +-------- Source/OpenTK/Platform/MacOS/MacOSKeyMap.cs | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/Source/OpenTK/Platform/MacOS/CocoaNativeWindow.cs b/Source/OpenTK/Platform/MacOS/CocoaNativeWindow.cs index 90c47a89..71f0ded6 100644 --- a/Source/OpenTK/Platform/MacOS/CocoaNativeWindow.cs +++ b/Source/OpenTK/Platform/MacOS/CocoaNativeWindow.cs @@ -135,7 +135,6 @@ namespace OpenTK.Platform.MacOS private Nullable deferredWindowBorder; private Nullable previousWindowBorder; private WindowState windowState = WindowState.Normal; - private MacOSKeyMap keyMap = new MacOSKeyMap(); private OpenTK.Input.KeyboardKeyEventArgs keyArgs = new OpenTK.Input.KeyboardKeyEventArgs(); private KeyPressEventArgs keyPressArgs = new KeyPressEventArgs((char)0); private string title; @@ -337,13 +336,7 @@ namespace OpenTK.Platform.MacOS private void GetKey(ushort keyCode, NSEventModifierMask modifierFlags, OpenTK.Input.KeyboardKeyEventArgs args) { - OpenTK.Input.Key key; - if (!keyMap.TryGetValue((OpenTK.Platform.MacOS.Carbon.MacOSKeyCode)keyCode, out key)) - { - key = OpenTK.Input.Key.Unknown; - } - - args.Key = key; + args.Key = MacOSKeyMap.GetKey((Carbon.MacOSKeyCode)keyCode); args.Modifiers = GetModifiers(modifierFlags); args.ScanCode = (uint)keyCode; } diff --git a/Source/OpenTK/Platform/MacOS/MacOSKeyMap.cs b/Source/OpenTK/Platform/MacOS/MacOSKeyMap.cs index 35f19467..103bd579 100644 --- a/Source/OpenTK/Platform/MacOS/MacOSKeyMap.cs +++ b/Source/OpenTK/Platform/MacOS/MacOSKeyMap.cs @@ -36,7 +36,7 @@ namespace OpenTK.Platform.MacOS using Carbon; using Input; - class MacOSKeyMap + static class MacOSKeyMap { public static Key GetKey(MacOSKeyCode code) {