Supress printing of some keyboard non-errors.
This commit is contained in:
parent
39c3f3f543
commit
c98d9e4503
2 changed files with 8 additions and 4 deletions
|
@ -255,12 +255,16 @@ namespace OpenTK.Platform.MacOS
|
||||||
HIDPage page = NativeMethods.IOHIDElementGetUsagePage(elem);
|
HIDPage page = NativeMethods.IOHIDElementGetUsagePage(elem);
|
||||||
int usage = NativeMethods.IOHIDElementGetUsage(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.GenericDesktop:
|
||||||
case HIDPage.KeyboardOrKeypad:
|
case HIDPage.KeyboardOrKeypad:
|
||||||
int raw = (int)usage;
|
int raw = (int) usage;
|
||||||
if (raw >= RawKeyMap.Length || raw < 0)
|
if (raw >= RawKeyMap.Length)
|
||||||
{
|
{
|
||||||
Debug.Print("[Warning] Key {0} not mapped.", raw);
|
Debug.Print("[Warning] Key {0} not mapped.", raw);
|
||||||
return state;
|
return state;
|
||||||
|
|
Loading…
Reference in a new issue