summaryrefslogtreecommitdiff
path: root/indra/llwindow/llkeyboardmacosx.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-10-17 16:56:21 +0300
committerGitHub <noreply@github.com>2024-10-17 16:56:21 +0300
commit0ef7a9b39cf72da1211039ab22bdf8f9f6a2c984 (patch)
tree6f51ef179497265b5bff2a355471ae5dc9643ad2 /indra/llwindow/llkeyboardmacosx.cpp
parent9e24b300d02e5627ea0d304d412cb683ec2de3a4 (diff)
parentd3d349ae0f17a72481f30b9354b9367b1cd3b639 (diff)
Merge pull request #2856 from secondlife/marchcat/c-develop
Develop → Maint C sync
Diffstat (limited to 'indra/llwindow/llkeyboardmacosx.cpp')
-rw-r--r--indra/llwindow/llkeyboardmacosx.cpp31
1 files changed, 16 insertions, 15 deletions
diff --git a/indra/llwindow/llkeyboardmacosx.cpp b/indra/llwindow/llkeyboardmacosx.cpp
index a1aeb2e5e4..1a403e5d94 100644
--- a/indra/llwindow/llkeyboardmacosx.cpp
+++ b/indra/llwindow/llkeyboardmacosx.cpp
@@ -162,7 +162,7 @@ LLKeyboardMacOSX::LLKeyboardMacOSX()
void LLKeyboardMacOSX::resetMaskKeys()
{
- U32 mask = getModifiers();
+ MASK mask = getModifiers();
// MBW -- XXX -- This mirrors the operation of the Windows version of resetMaskKeys().
// It looks a bit suspicious, as it won't correct for keys that have been released.
@@ -172,22 +172,22 @@ void LLKeyboardMacOSX::resetMaskKeys()
if(mask & MAC_SHIFT_KEY)
{
- mKeyLevel[KEY_SHIFT] = TRUE;
+ mKeyLevel[KEY_SHIFT] = true;
}
if(mask & MAC_CTRL_KEY)
{
- mKeyLevel[KEY_CONTROL] = TRUE;
+ mKeyLevel[KEY_CONTROL] = true;
}
if(mask & MAC_ALT_KEY)
{
- mKeyLevel[KEY_ALT] = TRUE;
+ mKeyLevel[KEY_ALT] = true;
}
}
/*
-static BOOL translateKeyMac(const U16 key, const U32 mask, KEY &outKey, U32 &outMask)
+static bool translateKeyMac(const U16 key, const MASK mask, KEY &outKey, U32 &outMask)
{
// Translate the virtual keycode into the keycodes the keyboard system expects.
U16 virtualKey = (mask >> 24) & 0x0000007F;
@@ -203,7 +203,7 @@ void LLKeyboardMacOSX::handleModifier(MASK mask)
updateModifiers(mask);
}
-MASK LLKeyboardMacOSX::updateModifiers(const U32 mask)
+MASK LLKeyboardMacOSX::updateModifiers(const MASK mask)
{
// translate the mask
MASK out_mask = 0;
@@ -226,11 +226,11 @@ MASK LLKeyboardMacOSX::updateModifiers(const U32 mask)
return out_mask;
}
-BOOL LLKeyboardMacOSX::handleKeyDown(const U16 key, const U32 mask)
+bool LLKeyboardMacOSX::handleKeyDown(const U16 key, MASK mask)
{
KEY translated_key = 0;
U32 translated_mask = 0;
- BOOL handled = FALSE;
+ bool handled = false;
translated_mask = updateModifiers(mask);
@@ -243,11 +243,11 @@ BOOL LLKeyboardMacOSX::handleKeyDown(const U16 key, const U32 mask)
}
-BOOL LLKeyboardMacOSX::handleKeyUp(const U16 key, const U32 mask)
+bool LLKeyboardMacOSX::handleKeyUp(const U16 key, MASK mask)
{
KEY translated_key = 0;
U32 translated_mask = 0;
- BOOL handled = FALSE;
+ bool handled = false;
translated_mask = updateModifiers(mask);
@@ -259,10 +259,10 @@ BOOL LLKeyboardMacOSX::handleKeyUp(const U16 key, const U32 mask)
return handled;
}
-MASK LLKeyboardMacOSX::currentMask(BOOL for_mouse_event)
+MASK LLKeyboardMacOSX::currentMask(bool for_mouse_event)
{
MASK result = MASK_NONE;
- U32 mask = getModifiers();
+ MASK mask = getModifiers();
if (mask & MAC_SHIFT_KEY) result |= MASK_SHIFT;
if (mask & MAC_CTRL_KEY) result |= MASK_CONTROL;
@@ -291,12 +291,13 @@ void LLKeyboardMacOSX::scanKeyboard()
mCallbacks->handleScanKey(key, mKeyDown[key], mKeyUp[key], mKeyLevel[key]);
}
}
+ mCurScanKey = KEY_NONE;
// Reset edges for next frame
for (key = 0; key < KEY_COUNT; key++)
{
- mKeyUp[key] = FALSE;
- mKeyDown[key] = FALSE;
+ mKeyUp[key] = false;
+ mKeyDown[key] = false;
if (mKeyLevel[key])
{
mKeyLevelFrameCount[key]++;
@@ -304,7 +305,7 @@ void LLKeyboardMacOSX::scanKeyboard()
}
}
-BOOL LLKeyboardMacOSX::translateNumpadKey( const U16 os_key, KEY *translated_key )
+bool LLKeyboardMacOSX::translateNumpadKey( const U16 os_key, KEY *translated_key )
{
return translateKey(os_key, translated_key);
}