diff options
author | rider <rider@lindenlab.com> | 2015-11-13 16:22:34 -0800 |
---|---|---|
committer | rider <rider@lindenlab.com> | 2015-11-13 16:22:34 -0800 |
commit | c2ad041c23b0097aec30acc7447a42f96d515d3b (patch) | |
tree | 6d3632e4ef5e9b9bdae8aeb34f0b4839531464fc /indra/llwindow/llwindowmacosx.cpp | |
parent | a9a3cafa9194794850f97bec15e1d176389dd7eb (diff) |
Encode keyboard event for reconstruction in the plugin.
Diffstat (limited to 'indra/llwindow/llwindowmacosx.cpp')
-rwxr-xr-x | indra/llwindow/llwindowmacosx.cpp | 39 |
1 files changed, 6 insertions, 33 deletions
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 7bc5d263e4..952c6751db 100755 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -1726,39 +1726,12 @@ LLSD LLWindowMacOSX::getNativeKeyData() #if 1 if(mRawKeyEvent) { - - result["char_code"] = (S32)(mRawKeyEvent)->mCharacter; - result["scan_code"] = (S32)(mRawKeyEvent)->mScanCode; - result["key_code"] = (S32)(mRawKeyEvent->mKeyCode); - result["modifiers"] = (S32)(mRawKeyEvent->mKeyModifiers); - result["keyboard_type"] = (S32)(mRawKeyEvent->mKeyboardType); - - -#if 0 - // This causes trouble for control characters -- apparently character codes less than 32 (escape, control-A, etc) - // cause llsd serialization to create XML that the llsd deserializer won't parse! - std::string unicode; - S32 err = noErr; - EventParamType actualType = typeUTF8Text; - UInt32 actualSize = 0; - char *buffer = NULL; - - err = GetEventParameter (mRawKeyEvent, kEventParamKeyUnicodes, typeUTF8Text, &actualType, 0, &actualSize, NULL); - if(err == noErr) - { - // allocate a buffer and get the actual data. - buffer = new char[actualSize]; - err = GetEventParameter (mRawKeyEvent, kEventParamKeyUnicodes, typeUTF8Text, &actualType, actualSize, &actualSize, buffer); - if(err == noErr) - { - unicode.assign(buffer, actualSize); - } - delete[] buffer; - } - - result["unicode"] = unicode; -#endif - + result["event_type"] = LLSD::Integer(mRawKeyEvent->mEventType); + result["event_modifiers"] = LLSD::Integer(mRawKeyEvent->mEventModifiers); + result["event_keycode"] = LLSD::Integer(mRawKeyEvent->mEventKeyCode); + result["event_chars"] = (mRawKeyEvent->mEventChars) ? LLSD(LLSD::Integer(mRawKeyEvent->mEventChars)) : LLSD(); + result["event_umodchars"] = (mRawKeyEvent->mEventUnmodChars) ? LLSD(LLSD::Integer(mRawKeyEvent->mEventUnmodChars)) : LLSD(); + result["event_isrepeat"] = LLSD::Boolean(mRawKeyEvent->mEventRepeat); } #endif |