diff options
author | Leviathan Linden <leviathan@lindenlab.com> | 2023-09-19 09:40:08 -0700 |
---|---|---|
committer | Andrew Meadows <andrew.l.meadows@gmail.com> | 2024-10-03 09:01:06 -0700 |
commit | 13221f67c465017f44ca46aeca23b0d820935825 (patch) | |
tree | a38de052ac3adb3160cfca76abbadf77b321cc71 /indra/llwindow/llkeyboard.cpp | |
parent | 49c661f6cf9ae0a75b93c870a00edba59df54189 (diff) |
add GameControl feature and SDL2 dependency
Diffstat (limited to 'indra/llwindow/llkeyboard.cpp')
-rw-r--r-- | indra/llwindow/llkeyboard.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/indra/llwindow/llkeyboard.cpp b/indra/llwindow/llkeyboard.cpp index a16c0a318a..a858d3b16f 100644 --- a/indra/llwindow/llkeyboard.cpp +++ b/indra/llwindow/llkeyboard.cpp @@ -29,6 +29,7 @@ #include "llkeyboard.h" #include "llwindowcallbacks.h" +#include "llgamecontrol.h" // // Globals @@ -161,6 +162,7 @@ void LLKeyboard::resetKeyDownAndHandle() mCallbacks->handleTranslatedKeyUp(i, mask); } } + LLGameControl::clearAllKeys(); } // BUG this has to be called when an OS dialog is shown, otherwise modifier key state @@ -275,6 +277,43 @@ bool LLKeyboard::handleTranslatedKeyUp(KEY translated_key, U32 translated_mask) return handled; } +bool LLKeyboard::handleKeyDown(const U16 key, const U32 mask) +{ + U32 translated_mask = updateModifiers(mask); + + KEY translated_key = 0; + bool handled = false; + if(translateKey(key, &translated_key)) + { + handled = handleTranslatedKeyDown(translated_key, translated_mask); + } + if (!handled) + { + LLGameControl::onKeyDown(translated_key, translated_mask); + } + + return handled; +} + + +bool LLKeyboard::handleKeyUp(const U16 key, const U32 mask) +{ + U32 translated_mask = updateModifiers(mask); + + KEY translated_key = 0; + bool handled = false; + if(translateKey(key, &translated_key)) + { + handled = handleTranslatedKeyUp(translated_key, translated_mask); + } + if (!handled) + { + LLGameControl::onKeyUp(translated_key, translated_mask); + } + + return handled; +} + void LLKeyboard::toggleInsertMode() { |