summaryrefslogtreecommitdiff
path: root/indra/llwindow/llkeyboardsdl.cpp
diff options
context:
space:
mode:
authorAndrew Meadows <leviathan@lindenlab.com>2024-10-04 11:07:47 -0700
committerGitHub <noreply@github.com>2024-10-04 11:07:47 -0700
commitf89abf259dddfe9086de9d96e0b6d65a427f2971 (patch)
treed90b74f4ec320a3bc53a889eb5ba41d18b00ab52 /indra/llwindow/llkeyboardsdl.cpp
parent4339ad9a528c82946ce40ec2bd240b41d104f338 (diff)
parent2f07279ccaf5aecc45ed9a78d337e73ab58d89a7 (diff)
Merge pull request #1934 from secondlife/leviathan/game-control
Add GameControl behind feature-flag
Diffstat (limited to 'indra/llwindow/llkeyboardsdl.cpp')
-rw-r--r--indra/llwindow/llkeyboardsdl.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/indra/llwindow/llkeyboardsdl.cpp b/indra/llwindow/llkeyboardsdl.cpp
index 543882fc8f..b6666195a6 100644
--- a/indra/llwindow/llkeyboardsdl.cpp
+++ b/indra/llwindow/llkeyboardsdl.cpp
@@ -26,7 +26,7 @@
#include "linden_common.h"
#include "llkeyboardsdl.h"
#include "llwindowcallbacks.h"
-#include "SDL2/SDL.h"
+
#include "SDL2/SDL_keycode.h"
LLKeyboardSDL::LLKeyboardSDL()
@@ -42,7 +42,7 @@ LLKeyboardSDL::LLKeyboardSDL()
// <FS:ND> Looks like we need to map those despite of SDL_TEXTINPUT handling most of this, but without
// the translation lower->upper here accelerators will not work.
- U16 cur_char;
+ LLKeyboard::NATIVE_KEY_TYPE cur_char;
for (cur_char = 'A'; cur_char <= 'Z'; cur_char++)
{
mTranslateKeyMap[cur_char] = cur_char;
@@ -177,7 +177,7 @@ void LLKeyboardSDL::resetMaskKeys()
}
-MASK LLKeyboardSDL::updateModifiers(const U32 mask)
+MASK LLKeyboardSDL::updateModifiers(const MASK mask)
{
// translate the mask
MASK out_mask = MASK_NONE;
@@ -201,7 +201,7 @@ MASK LLKeyboardSDL::updateModifiers(const U32 mask)
}
-static U32 adjustNativekeyFromUnhandledMask(const U32 key, const U32 mask)
+U32 adjustNativekeyFromUnhandledMask(const LLKeyboard::NATIVE_KEY_TYPE key, const MASK mask)
{
// SDL doesn't automatically adjust the keysym according to
// whether NUMLOCK is engaged, so we massage the keysym manually.
@@ -226,11 +226,11 @@ static U32 adjustNativekeyFromUnhandledMask(const U32 key, const U32 mask)
}
-bool LLKeyboardSDL::handleKeyDown(const U32 key, const U32 mask)
+bool LLKeyboardSDL::handleKeyDown(const LLKeyboard::NATIVE_KEY_TYPE key, const MASK mask)
{
U32 adjusted_nativekey;
KEY translated_key = 0;
- U32 translated_mask = MASK_NONE;
+ MASK translated_mask = MASK_NONE;
bool handled = false;
adjusted_nativekey = adjustNativekeyFromUnhandledMask(key, mask);
@@ -246,7 +246,7 @@ bool LLKeyboardSDL::handleKeyDown(const U32 key, const U32 mask)
}
-bool LLKeyboardSDL::handleKeyUp(const U32 key, const U32 mask)
+bool LLKeyboardSDL::handleKeyUp(const LLKeyboard::NATIVE_KEY_TYPE key, const MASK mask)
{
U32 adjusted_nativekey;
KEY translated_key = 0;
@@ -300,6 +300,7 @@ void LLKeyboardSDL::scanKeyboard()
mCallbacks->handleScanKey(key, mKeyDown[key], mKeyUp[key], mKeyLevel[key]);
}
}
+ mCurScanKey = KEY_NONE;
// Reset edges for next frame
for (S32 key = 0; key < KEY_COUNT; key++)
@@ -314,12 +315,12 @@ void LLKeyboardSDL::scanKeyboard()
}
-bool LLKeyboardSDL::translateNumpadKey( const U32 os_key, KEY *translated_key)
+bool LLKeyboardSDL::translateNumpadKey( const LLKeyboard::NATIVE_KEY_TYPE os_key, KEY *translated_key)
{
return translateKey(os_key, translated_key);
}
-U16 LLKeyboardSDL::inverseTranslateNumpadKey(const KEY translated_key)
+LLKeyboard::NATIVE_KEY_TYPE LLKeyboardSDL::inverseTranslateNumpadKey(const KEY translated_key)
{
return inverseTranslateKey(translated_key);
}
@@ -497,7 +498,6 @@ enum class WindowsVK : U32
};
std::map< U32, U32 > mSDL2_to_Win;
-std::set< U32 > mIgnoreSDL2Keys;
U32 LLKeyboardSDL::mapSDL2toWin( U32 aSymbol )
{