From 07baa83ef273f41135b886363b34c423a566bffc Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 14 Dec 2022 20:49:56 +0200 Subject: SL-18384 Fix NSException for keyboard handling Affects accent keys for diacritical marks --- indra/llwindow/llopenglview-objc.mm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index 049226db65..7936245744 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -495,7 +495,12 @@ attributedStringInfo getSegments(NSAttributedString *str) // e.g. OS Window for upload something or Input Window... // mModifiers instance variable is for insertText: or insertText:replacementRange: (by Pell Smit) mModifiers = [theEvent modifierFlags]; - unichar ch = [[theEvent charactersIgnoringModifiers] characterAtIndex:0]; + NSString *str_no_modifiers = [theEvent charactersIgnoringModifiers]; + unichar ch = 0; + if (str_no_modifiers.length) + { + ch = [str_no_modifiers characterAtIndex:0]; + } bool acceptsText = mHasMarkedText ? false : callKeyDown(&eventData, keycode, mModifiers, ch); if (acceptsText && -- cgit v1.2.3