From 8c66659159bc347995ac65389faff1ecb1b6b127 Mon Sep 17 00:00:00 2001 From: Erik Kundiman Date: Thu, 14 Sep 2023 13:00:26 +0800 Subject: getNativeKeyData impl for non Darwin non GTK Copying from GTK users part though. --- indra/llwindow/llwindowsdl.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'indra') diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index b982f4e290..5626707e70 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -2590,6 +2590,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 -- cgit v1.2.3