diff options
author | RunitaiLinden <davep@lindenlab.com> | 2023-06-15 16:55:33 -0500 |
---|---|---|
committer | RunitaiLinden <davep@lindenlab.com> | 2023-06-15 16:55:33 -0500 |
commit | 3b8d7c61725182a4ba1d4e0b96066f6dd53b80c4 (patch) | |
tree | 114c02fef2c10fa3fde2a97b816d98777f4d5761 /indra | |
parent | b132e2eea87b7c58a92057244ab681d3466cbafe (diff) | |
parent | cb8c91ffc8e6c40dfd6cb86922ac3c6968855466 (diff) |
Merge branch 'DRTVWR-559' of github.com:secondlife/viewer into DRTVWR-559
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llwindow/llopenglview-objc.mm | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index 9d497691d8..586e00b5e4 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -550,7 +550,16 @@ attributedStringInfo getSegments(NSAttributedString *str) if (mModifiers & mask) { eventData.mKeyEvent = NativeKeyEventData::KEYDOWN; - callKeyDown(&eventData, [theEvent keyCode], 0, [[theEvent characters] characterAtIndex:0]); + + wchar_t c = 0; + if([theEvent type] == NSEventTypeKeyDown) + { + // characters property is only valid when the event is of type KeyDown or KeyUp + // https://developer.apple.com/documentation/appkit/nsevent/1534183-characters?language=objc + c = [[theEvent characters] characterAtIndex:0]; + } + + callKeyDown(&eventData, [theEvent keyCode], 0, c); } else { |