diff options
author | Erik Kundiman <erik@megapahit.org> | 2023-09-14 13:00:26 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2023-09-14 13:00:26 +0800 |
commit | 8c66659159bc347995ac65389faff1ecb1b6b127 (patch) | |
tree | f9eed2310e335aa7d52735fc9e0551c936a3135e /indra/llwindow | |
parent | 9a83ffbb902ada9cf5bde1559f2429f793b589eb (diff) |
getNativeKeyData impl for non Darwin non GTK
Copying from GTK users part though.
Diffstat (limited to 'indra/llwindow')
-rw-r--r-- | indra/llwindow/llwindowsdl.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
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 |