summaryrefslogtreecommitdiff
path: root/indra/llwindow
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2012-05-25 18:45:27 -0700
committerTodd Stinson <stinson@lindenlab.com>2012-05-25 18:45:27 -0700
commitb8bc62a514786121ac34857c0e052040e603d4e4 (patch)
treebfcfda56d2331d92efe98294f68b04146b15770d /indra/llwindow
parentb2b446aed7f7f32151bc152ba25d44253ebf864f (diff)
parent403ed9656bf4c0c92004cce44d08972b9bd6ee43 (diff)
Pull and merge from ssh://hg@bitbucket.org/lindenlab/viewer-release.
Diffstat (limited to 'indra/llwindow')
-rw-r--r--indra/llwindow/llkeyboard.cpp2
-rw-r--r--indra/llwindow/llkeyboard.h12
-rw-r--r--indra/llwindow/llkeyboardmacosx.cpp17
-rw-r--r--indra/llwindow/llkeyboardsdl.cpp20
-rw-r--r--indra/llwindow/llkeyboardwin32.cpp60
5 files changed, 4 insertions, 107 deletions
diff --git a/indra/llwindow/llkeyboard.cpp b/indra/llwindow/llkeyboard.cpp
index 53cecf9d4a..8b356ba138 100644
--- a/indra/llwindow/llkeyboard.cpp
+++ b/indra/llwindow/llkeyboard.cpp
@@ -46,7 +46,7 @@ LLKeyStringTranslatorFunc* LLKeyboard::mStringTranslator = NULL; // Used for l10
// Class Implementation
//
-LLKeyboard::LLKeyboard() : mCallbacks(NULL), mNumpadDistinct(ND_NUMLOCK_OFF)
+LLKeyboard::LLKeyboard() : mCallbacks(NULL)
{
S32 i;
diff --git a/indra/llwindow/llkeyboard.h b/indra/llwindow/llkeyboard.h
index ba472cfde5..c155c1b362 100644
--- a/indra/llwindow/llkeyboard.h
+++ b/indra/llwindow/llkeyboard.h
@@ -63,14 +63,6 @@ class LLWindowCallbacks;
class LLKeyboard
{
public:
- typedef enum e_numpad_distinct
- {
- ND_NEVER,
- ND_NUMLOCK_OFF,
- ND_NUMLOCK_ON
- } ENumpadDistinct;
-
-public:
LLKeyboard();
virtual ~LLKeyboard();
@@ -107,8 +99,6 @@ public:
static BOOL keyFromString(const std::string& str, KEY *key); // False on failure
static std::string stringFromKey(KEY key);
static std::string stringFromAccelerator( MASK accel_mask, KEY key );
- e_numpad_distinct getNumpadDistinct() { return mNumpadDistinct; }
- void setNumpadDistinct(e_numpad_distinct val) { mNumpadDistinct = val; }
void setCallbacks(LLWindowCallbacks *cbs) { mCallbacks = cbs; }
F32 getKeyElapsedTime( KEY key ); // Returns time in seconds since key was pressed.
@@ -135,8 +125,6 @@ protected:
static LLKeyStringTranslatorFunc* mStringTranslator; // Used for l10n + PC/Mac/Linux accelerator labeling
- e_numpad_distinct mNumpadDistinct;
-
EKeyboardInsertMode mInsertMode;
static std::map<KEY,std::string> sKeysToNames;
diff --git a/indra/llwindow/llkeyboardmacosx.cpp b/indra/llwindow/llkeyboardmacosx.cpp
index ecc2631669..7f8f303517 100644
--- a/indra/llwindow/llkeyboardmacosx.cpp
+++ b/indra/llwindow/llkeyboardmacosx.cpp
@@ -299,28 +299,11 @@ void LLKeyboardMacOSX::scanKeyboard()
BOOL LLKeyboardMacOSX::translateNumpadKey( const U16 os_key, KEY *translated_key )
{
- if(mNumpadDistinct == ND_NUMLOCK_ON)
- {
- std::map<U16, KEY>::iterator iter= mTranslateNumpadMap.find(os_key);
- if(iter != mTranslateNumpadMap.end())
- {
- *translated_key = iter->second;
- return TRUE;
- }
- }
return translateKey(os_key, translated_key);
}
U16 LLKeyboardMacOSX::inverseTranslateNumpadKey(const KEY translated_key)
{
- if(mNumpadDistinct == ND_NUMLOCK_ON)
- {
- std::map<KEY, U16>::iterator iter= mInvTranslateNumpadMap.find(translated_key);
- if(iter != mInvTranslateNumpadMap.end())
- {
- return iter->second;
- }
- }
return inverseTranslateKey(translated_key);
}
diff --git a/indra/llwindow/llkeyboardsdl.cpp b/indra/llwindow/llkeyboardsdl.cpp
index 4bb9603368..7c9aa1d340 100644
--- a/indra/llwindow/llkeyboardsdl.cpp
+++ b/indra/llwindow/llkeyboardsdl.cpp
@@ -312,29 +312,11 @@ void LLKeyboardSDL::scanKeyboard()
BOOL LLKeyboardSDL::translateNumpadKey( const U16 os_key, KEY *translated_key)
{
- if(mNumpadDistinct == ND_NUMLOCK_ON)
- {
- std::map<U16, KEY>::iterator iter= mTranslateNumpadMap.find(os_key);
- if(iter != mTranslateNumpadMap.end())
- {
- *translated_key = iter->second;
- return TRUE;
- }
- }
- BOOL success = translateKey(os_key, translated_key);
- return success;
+ return translateKey(os_key, translated_key);
}
U16 LLKeyboardSDL::inverseTranslateNumpadKey(const KEY translated_key)
{
- if(mNumpadDistinct == ND_NUMLOCK_ON)
- {
- std::map<KEY, U16>::iterator iter= mInvTranslateNumpadMap.find(translated_key);
- if(iter != mInvTranslateNumpadMap.end())
- {
- return iter->second;
- }
- }
return inverseTranslateKey(translated_key);
}
diff --git a/indra/llwindow/llkeyboardwin32.cpp b/indra/llwindow/llkeyboardwin32.cpp
index df78816bd6..be3fe5deb0 100644
--- a/indra/llwindow/llkeyboardwin32.cpp
+++ b/indra/llwindow/llkeyboardwin32.cpp
@@ -299,69 +299,13 @@ void LLKeyboardWin32::scanKeyboard()
BOOL LLKeyboardWin32::translateExtendedKey(const U16 os_key, const MASK mask, KEY *translated_key)
{
- if(mNumpadDistinct == ND_NUMLOCK_ON)
- {
- std::map<U16, KEY>::iterator iter = mTranslateNumpadMap.find(os_key);
- if (iter != mTranslateNumpadMap.end())
- {
- *translated_key = iter->second;
- return TRUE;
- }
- }
-
- BOOL success = translateKey(os_key, translated_key);
- if(mNumpadDistinct != ND_NEVER) {
- if(!success) return success;
- if(mask & MASK_EXTENDED)
- {
- // this is where we'd create new keycodes for extended keys
- // the set of extended keys includes the 'normal' arrow keys and
- // the pgup/dn/insert/home/end/delete cluster above the arrow keys
- // see http://windowssdk.msdn.microsoft.com/en-us/library/ms646280.aspx
-
- // only process the return key if numlock is off
- if(((mNumpadDistinct == ND_NUMLOCK_OFF &&
- !(GetKeyState(VK_NUMLOCK) & 1))
- || mNumpadDistinct == ND_NUMLOCK_ON) &&
- *translated_key == KEY_RETURN) {
- *translated_key = KEY_PAD_RETURN;
- }
- }
- else
- {
- // the non-extended keys, those are in the numpad
- switch (*translated_key)
- {
- case KEY_LEFT:
- *translated_key = KEY_PAD_LEFT; break;
- case KEY_RIGHT:
- *translated_key = KEY_PAD_RIGHT; break;
- case KEY_UP:
- *translated_key = KEY_PAD_UP; break;
- case KEY_DOWN:
- *translated_key = KEY_PAD_DOWN; break;
- case KEY_HOME:
- *translated_key = KEY_PAD_HOME; break;
- case KEY_END:
- *translated_key = KEY_PAD_END; break;
- case KEY_PAGE_UP:
- *translated_key = KEY_PAD_PGUP; break;
- case KEY_PAGE_DOWN:
- *translated_key = KEY_PAD_PGDN; break;
- case KEY_INSERT:
- *translated_key = KEY_PAD_INS; break;
- case KEY_DELETE:
- *translated_key = KEY_PAD_DEL; break;
- }
- }
- }
- return success;
+ return translateKey(os_key, translated_key);
}
U16 LLKeyboardWin32::inverseTranslateExtendedKey(const KEY translated_key)
{
// if numlock is on, then we need to translate KEY_PAD_FOO to the corresponding number pad number
- if((mNumpadDistinct == ND_NUMLOCK_ON) && (GetKeyState(VK_NUMLOCK) & 1))
+ if(GetKeyState(VK_NUMLOCK) & 1)
{
std::map<KEY, U16>::iterator iter = mInvTranslateNumpadMap.find(translated_key);
if (iter != mInvTranslateNumpadMap.end())