summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Luby <plubius@neooffice.org>2023-01-17 16:26:00 -0500
committerPatrick Luby <plubius@neooffice.org>2023-01-19 13:47:47 +0000
commitd6958883a48d5ed4774b558f5e1fe9f878b7d2f5 (patch)
treee37ca79fd188abcb839d03a9c655b6eac27677c8
parentResolves: tdf#153059 after ChangeHeaderOrFooter the control can be disposed (diff)
downloadcore-d6958883a48d5ed4774b558f5e1fe9f878b7d2f5.tar.gz
core-d6958883a48d5ed4774b558f5e1fe9f878b7d2f5.zip
Related: tdf#42437 Skip special press-and-hold handling for action keys
Pressing and holding action keys such as arrow keys must not be handled like pressing and holding a character key as it will insert unexpected text. Change-Id: I6beaff265e6cae30337b025791692ff67b760ff8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145592 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Reviewed-by: Patrick Luby <plubius@neooffice.org> Tested-by: Patrick Luby <plubius@neooffice.org>
-rw-r--r--vcl/osx/salframeview.mm12
1 files changed, 10 insertions, 2 deletions
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 355fc84a76b4..09643b5c307d 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -1028,7 +1028,11 @@ static AquaSalFrame* getMouseContainerFrame()
// Handle repeat key events by explicitly inserting the text if
// -[NSResponder interpretKeyEvents:] does not insert or mark any
// text. Note: do not do this step if there is uncommitted text.
- if ( !mpLastMarkedText && mpLastEvent && [mpLastEvent type] == NSEventTypeKeyDown && [mpLastEvent isARepeat] )
+ // Related: tdf#42437 Skip special press-and-hold handling for action keys
+ // Pressing and holding action keys such as arrow keys must not be
+ // handled like pressing and holding a character key as it will
+ // insert unexpected text.
+ if ( !mbKeyHandled && !mpLastMarkedText && mpLastEvent && [mpLastEvent type] == NSEventTypeKeyDown && [mpLastEvent isARepeat] )
{
NSString *pChars = [mpLastEvent characters];
[self insertText:pChars replacementRange:NSMakeRange( 0, [pChars length] )];
@@ -1177,9 +1181,13 @@ static AquaSalFrame* getMouseContainerFrame()
mpFrame->CallCallback( SalEvent::EndExtTextInput, nullptr );
}
- mbKeyHandled = true;
[self unmarkText];
}
+
+ // Mark event as handled even if the frame isn't valid like is done in
+ // [self setMarkedText:selectedRange:replacementRange:] and
+ // [self doCommandBySelector:]
+ mbKeyHandled = true;
}
-(void)insertTab: (id)aSender