File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
native/Avalonia.Native/src/OSX Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -550,6 +550,8 @@ - (void)keyDown:(NSEvent *)event
550
550
if (hasInputModifier){
551
551
if ([self handleKeyDown: timestamp withKey: key withPhysicalKey: physicalKey withModifiers: modifiers withKeySymbol: keySymbol]){
552
552
// User code has handled the event
553
+ _lastKeyDownEvent = nullptr ;
554
+
553
555
return ;
554
556
}
555
557
}
@@ -567,10 +569,14 @@ - (void)keyDown:(NSEvent *)event
567
569
// InputMethod not active
568
570
else {
569
571
auto keyDownHandled = [self handleKeyDown: timestamp withKey: key withPhysicalKey: physicalKey withModifiers: modifiers withKeySymbol: keySymbol];
570
-
571
- // Raise text input event for unhandled key down if there is some key symbol and no input modifier is present
572
- if (!keyDownHandled && modifiers == AvnInputModifiersNone && keySymbol != NULL ){
573
- _parent->BaseEvents ->RawTextInputEvent (timestamp, [keySymbol UTF8String ]);
572
+
573
+ // Raise text input event for unhandled key down
574
+ if (!keyDownHandled){
575
+ if (keySymbol != nullptr && key != AvnKeyEnter){
576
+ auto timestamp = static_cast <uint64_t >([event timestamp ] * 1000 );
577
+
578
+ _parent->BaseEvents ->RawTextInputEvent (timestamp, [keySymbol UTF8String ]);
579
+ }
574
580
}
575
581
}
576
582
You can’t perform that action at this time.
0 commit comments