diff options
author | Patrick Luby <plubius@neooffice.org> | 2022-12-20 10:30:00 -0500 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-12-22 16:43:55 +0000 |
commit | 1e4ef6d69b22f6674aefb415edf2e8e7ca78ff2d (patch) | |
tree | 3b8d902e9d49b2bac825995a4c4dc908efff0ecf /vcl/inc | |
parent | bf3562cf38c2dd7776a160ee8259a6fb97c0e7ba (diff) |
tdf#42437 Enable press-and-hold special character input method
The first step to enable this input method is to always return a valid selected
range location. -[NSResponder interpretKeyEvents:] will not call
[self firstRectForCharacterRange:actualRange:] if the selected range location
is NSNotFound so that is what was disabling display of the press-and-hold
input method popup.
Once [self firstRectForCharacterRange:actualRange:] is called, emulate the
press-and-hold behavior of the TextEdit application by setting the marked text
to the last key down event's characters. The characters will already have been
committed by the special character input method so set the
mbTextInputWantsNonRepeatKeyDown flag to indicate that the characters need to
be deleted if the input method replaces the committed characters.
Also, emulate the press-and-hold behavior of the TextEdit application by
committing any uncommitted text when either the escape or the return key is
pressed while the press-and-hold input method popup is displayed.
Lastly, handle repeat key events by explicitly inserting the text if there is
no uncommitted text before -[NSResponder interpretKeyEvents:] is called.
Change-Id: I104b3d64a8c66fef3a5a1cec0fba1daa553cd9a4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144630
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/inc')
-rw-r--r-- | vcl/inc/osx/salframeview.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/vcl/inc/osx/salframeview.h b/vcl/inc/osx/salframeview.h index 4ec0b6c06651..2fcff0d1c1e5 100644 --- a/vcl/inc/osx/salframeview.h +++ b/vcl/inc/osx/salframeview.h @@ -86,6 +86,7 @@ enum class SalEvent; BOOL mbInEndExtTextInput; BOOL mbInCommitMarkedText; NSAttributedString* mpLastMarkedText; + BOOL mbTextInputWantsNonRepeatKeyDown; } +(void)unsetMouseFrame: (AquaSalFrame*)pFrame; -(id)initWithSalFrame: (AquaSalFrame*)pFrame; @@ -217,6 +218,7 @@ enum class SalEvent; -(void)endExtTextInput; -(void)endExtTextInput:(EndExtTextInputFlags)nFlags; +-(void)deleteTextInputWantsNonRepeatKeyDown; @end |