summaryrefslogtreecommitdiff
path: root/indra/llwindow/llkeyboard.h
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-06-20 16:16:37 +0800
committerErik Kundiman <erik@megapahit.org>2024-06-20 20:52:45 +0800
commitad5dec92bcb7d11e6a48b6ec6a220a49de985351 (patch)
tree3870c4c7f1c9521c6ad40d1cfe1b1d8fc39882ef /indra/llwindow/llkeyboard.h
parent16299d3a3631e4c42367cf40410ad6995e585384 (diff)
parenta65bc46b138b89200586b29fe729cbc7b0f0c8c4 (diff)
Merge remote-tracking branch 'secondlife/release/maint-b' into maint-b
Diffstat (limited to 'indra/llwindow/llkeyboard.h')
-rw-r--r--indra/llwindow/llkeyboard.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/indra/llwindow/llkeyboard.h b/indra/llwindow/llkeyboard.h
index 1a6292f29f..2800b9fb60 100644
--- a/indra/llwindow/llkeyboard.h
+++ b/indra/llwindow/llkeyboard.h
@@ -55,6 +55,11 @@ class LLWindowCallbacks;
class LLKeyboard
{
public:
+#ifndef LL_SDL
+ typedef U16 NATIVE_KEY_TYPE;
+#else
+ typedef U32 NATIVE_KEY_TYPE;
+#endif
LLKeyboard();
virtual ~LLKeyboard();
@@ -67,14 +72,13 @@ public:
BOOL getKeyDown(const KEY key) { return mKeyLevel[key]; }
BOOL getKeyRepeated(const KEY key) { return mKeyRepeated[key]; }
- BOOL translateKey(const U32 os_key, KEY *translated_key);
- U32 inverseTranslateKey(const KEY translated_key);
+ BOOL translateKey(const NATIVE_KEY_TYPE os_key, KEY *translated_key);
+ NATIVE_KEY_TYPE inverseTranslateKey(const KEY translated_key);
BOOL handleTranslatedKeyUp(KEY translated_key, U32 translated_mask); // Translated into "Linden" keycodes
BOOL handleTranslatedKeyDown(KEY translated_key, U32 translated_mask); // Translated into "Linden" keycodes
-
- virtual BOOL handleKeyUp(const U32 key, MASK mask) = 0;
- virtual BOOL handleKeyDown(const U32 key, MASK mask) = 0;
+ virtual BOOL handleKeyUp(const NATIVE_KEY_TYPE key, MASK mask) = 0;
+ virtual BOOL handleKeyDown(const NATIVE_KEY_TYPE key, MASK mask) = 0;
#if defined(LL_DARWIN) && !defined(LL_SDL)
// We only actually use this for OS X.
@@ -111,8 +115,8 @@ protected:
void addKeyName(KEY key, const std::string& name);
protected:
- std::map<U32, KEY> mTranslateKeyMap; // Map of translations from OS keys to Linden KEYs
- std::map<KEY, U32> mInvTranslateKeyMap; // Map of translations from Linden KEYs to OS keys
+ std::map<NATIVE_KEY_TYPE, KEY> mTranslateKeyMap; // Map of translations from OS keys to Linden KEYs
+ std::map<KEY, NATIVE_KEY_TYPE> mInvTranslateKeyMap; // Map of translations from Linden KEYs to OS keys
LLWindowCallbacks *mCallbacks;
LLTimer mKeyLevelTimer[KEY_COUNT]; // Time since level was set