diff --git a/native/Avalonia.Native/src/OSX/AvnView.mm b/native/Avalonia.Native/src/OSX/AvnView.mm index ee124b1964..fc0d695384 100644 --- a/native/Avalonia.Native/src/OSX/AvnView.mm +++ b/native/Avalonia.Native/src/OSX/AvnView.mm @@ -550,6 +550,8 @@ if(hasInputModifier){ if([self handleKeyDown:timestamp withKey:key withPhysicalKey:physicalKey withModifiers:modifiers withKeySymbol:keySymbol]){ //User code has handled the event + _lastKeyDownEvent = nullptr; + return; } } @@ -567,10 +569,14 @@ //InputMethod not active else{ auto keyDownHandled = [self handleKeyDown:timestamp withKey:key withPhysicalKey:physicalKey withModifiers:modifiers withKeySymbol:keySymbol]; - - //Raise text input event for unhandled key down if there is some key symbol and no input modifier is present - if(!keyDownHandled && modifiers == AvnInputModifiersNone && keySymbol != NULL){ - _parent->BaseEvents->RawTextInputEvent(timestamp, [keySymbol UTF8String]); + + //Raise text input event for unhandled key down + if(!keyDownHandled){ + if(keySymbol != nullptr && key != AvnKeyEnter){ + auto timestamp = static_cast([event timestamp] * 1000); + + _parent->BaseEvents->RawTextInputEvent(timestamp, [keySymbol UTF8String]); + } } }