summaryrefslogtreecommitdiff
path: root/indra/llwindow
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2023-09-14 13:23:56 +0800
committerErik Kundiman <erik@megapahit.org>2023-09-14 13:23:56 +0800
commit8ba741e85049ce9d42d2e9d049dd62566d074f03 (patch)
treebcc0776cbe8db9ca17ae41886803e603469630de /indra/llwindow
parent6182ecc99033d08a8d044a745b884df8260e8128 (diff)
parent8c66659159bc347995ac65389faff1ecb1b6b127 (diff)
Merge branch 'main' into DRTVWR-559
Diffstat (limited to 'indra/llwindow')
-rw-r--r--indra/llwindow/llwindowsdl.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index f7efbd93f2..7f70c2ae5f 100644
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -2602,6 +2602,28 @@ LLSD LLWindowSDL::getNativeKeyData()
return result;
}
+#else
+
+LLSD LLWindowSDL::getNativeKeyData()
+{
+ LLSD result = LLSD::emptyMap();
+
+ U32 modifiers = 0;
+ modifiers |= (mKeyModifiers & KMOD_LSHIFT) ? 0x0001 : 0;
+ modifiers |= (mKeyModifiers & KMOD_RSHIFT) ? 0x0001 : 0;
+ modifiers |= (mKeyModifiers & KMOD_CAPS) ? 0x0002 : 0;
+ modifiers |= (mKeyModifiers & KMOD_LCTRL) ? 0x0004 : 0;
+ modifiers |= (mKeyModifiers & KMOD_RCTRL) ? 0x0004 : 0;
+ modifiers |= (mKeyModifiers & KMOD_LALT) ? 0x0008 : 0;
+ modifiers |= (mKeyModifiers & KMOD_RALT) ? 0x0008 : 0;
+
+ result["scan_code"] = (S32)mKeyScanCode;
+ result["virtual_key"] = (S32)mKeyVirtualKey;
+ result["modifiers"] = (S32)modifiers;
+
+ return result;
+}
+
#endif // LL_DARWIN
#endif // LL_GTK