Skip to content

Commit

Permalink
SL-19801 Inserting emoji characters from system emoji picker does not…
Browse files Browse the repository at this point in the history
… work on macOS
  • Loading branch information
LLGuru committed Nov 30, 2023
1 parent 2fad5a7 commit 54db420
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions indra/llwindow/llopenglview-objc.mm
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,19 @@ - (void)insertText:(id)insertString

- (void)insertText:(id)aString replacementRange:(NSRange)replacementRange
{
// SL-19801 Special workaround for system emoji picker
if ([aString length] == 2)
{
uint32_t b0 = [aString characterAtIndex:0];
uint32_t b1 = [aString characterAtIndex:1];
if (((b0 & 0xF000) == 0xD000) && ((b1 & 0xF000) == 0xD000))
{
uint32_t b = 0x10000 | ((b0 & 0x3F) << 10) | (b1 & 0x3FF);
callUnicodeCallback(b, 0);
return;
}
}

if (!mHasMarkedText)
{
for (NSInteger i = 0; i < [aString length]; i++)
Expand Down

0 comments on commit 54db420

Please sign in to comment.