public override void KeyDown(NSEvent theEvent) { ModifierFlags = theEvent.ModifierFlags; Key key; if (MonoMacEnums.TryGetUnoKey((NSKey)theEvent.KeyCode, out key)) { Bootstrapper.OnKeyDown(_unoWindow, key); } else { Debug.Log("Unsupported key code: " + theEvent.KeyCode, DebugMessageType.Error); } if (EnableText && IsTextInputEvent(ModifierFlags)) { var characters = theEvent.Characters.Where(CharacterIsNotSpecial).ToArray(); if (characters.Length == 0) { return; } Bootstrapper.OnTextInput(_unoWindow, new string (characters)); } }
public override void KeyUp(NSEvent theEvent) { ModifierFlags = theEvent.ModifierFlags; Key key; if (MonoMacEnums.TryGetUnoKey((NSKey)theEvent.KeyCode, out key)) { Bootstrapper.OnKeyUp(_unoWindow, key); } else { Debug.Log("Unsupported key code: " + theEvent.KeyCode, DebugMessageType.Error); } }