diff --git a/Source/Examples/OpenTK/Test/BasicMouseInput.cs b/Source/Examples/OpenTK/Test/BasicMouseInput.cs index 3e997291..a9c0284d 100644 --- a/Source/Examples/OpenTK/Test/BasicMouseInput.cs +++ b/Source/Examples/OpenTK/Test/BasicMouseInput.cs @@ -45,7 +45,7 @@ namespace Examples.Tests // While we are here, test keyboard. if(OpenTK.Input.Keyboard.GetState()[Key.A]){ - Console.WriteLine("The A key is down!"); + Console.WriteLine("The A key is down!"); } if (Keyboard[OpenTK.Input.Key.Escape]) diff --git a/Source/OpenTK/Platform/MacOS/HIDInput.cs b/Source/OpenTK/Platform/MacOS/HIDInput.cs index a706aac5..53e28da5 100755 --- a/Source/OpenTK/Platform/MacOS/HIDInput.cs +++ b/Source/OpenTK/Platform/MacOS/HIDInput.cs @@ -254,13 +254,17 @@ namespace OpenTK.Platform.MacOS int v_int = NativeMethods.IOHIDValueGetIntegerValue(val).ToInt32(); HIDPage page = NativeMethods.IOHIDElementGetUsagePage(elem); int usage = NativeMethods.IOHIDElementGetUsage(elem); + + // This will supress the debug printing below. Seems like it generates a lot of -1s. + // Couldn't find any details in USB spec or Apple docs for this behavior. + if(usage < 0 ) return state; - switch (page) + switch (page) { case HIDPage.GenericDesktop: case HIDPage.KeyboardOrKeypad: - int raw = (int)usage; - if (raw >= RawKeyMap.Length || raw < 0) + int raw = (int) usage; + if (raw >= RawKeyMap.Length) { Debug.Print("[Warning] Key {0} not mapped.", raw); return state;