Skip to content
Snippets Groups Projects

Linux dullahan

Merged Darl Cat requested to merge linux-cef into master
2 files
+ 27
26
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -2465,29 +2465,13 @@ S32 OSMessageBoxSDL(const std::string& text, const std::string& caption, U32 typ
*/
LLSD LLWindowSDL::getNativeKeyData()
{
LLSD result = LLSD::emptyMap();
U32 modifiers = 0; // pretend-native modifiers... oh what a tangled web we weave!
// we go through so many levels of device abstraction that I can't really guess
// what a plugin under GDK under Qt under SL under SDL under X11 considers
// a 'native' modifier mask. this has been sort of reverse-engineered... they *appear*
// to match GDK consts, but that may be co-incidence.
modifiers |= (mKeyModifiers & KMOD_LSHIFT) ? 0x0001 : 0;
modifiers |= (mKeyModifiers & KMOD_RSHIFT) ? 0x0001 : 0;// munge these into the same shift
modifiers |= (mKeyModifiers & KMOD_CAPS) ? 0x0002 : 0;
modifiers |= (mKeyModifiers & KMOD_LCTRL) ? 0x0004 : 0;
modifiers |= (mKeyModifiers & KMOD_RCTRL) ? 0x0004 : 0;// munge these into the same ctrl
modifiers |= (mKeyModifiers & KMOD_LALT) ? 0x0008 : 0;// untested
modifiers |= (mKeyModifiers & KMOD_RALT) ? 0x0008 : 0;// untested
// *todo: test ALTs - I don't have a case for testing these. Do you?
// *todo: NUM? - I don't care enough right now (and it's not a GDK modifier).
result["scan_code"] = (S32)mKeyScanCode;
result["virtual_key"] = (S32)mKeyVirtualKey;
result["modifiers"] = (S32)modifiers;
return result;
LLSD result = LLSD::emptyMap();
result["scan_code"] = (S32)mKeyScanCode;
result["virtual_key"] = (S32)mKeyVirtualKey;
result["modifiers"] = (S32)mKeyModifiers;
return result;
}
Loading