Fix inconsistent handling of Control, Alt, and Shift keys through a new modifier update callback.
parent
e17d69d1d1
commit
4a935b6815
|
|
@ -82,6 +82,11 @@ public:
|
|||
|
||||
virtual BOOL handleKeyUp(const U16 key, MASK mask) = 0;
|
||||
virtual BOOL handleKeyDown(const U16 key, MASK mask) = 0;
|
||||
|
||||
#ifdef LL_DARWIN
|
||||
// We only actually use this for OS X.
|
||||
virtual void handleModifier(MASK mask) = 0;
|
||||
#endif // LL_DARWIN
|
||||
|
||||
// Asynchronously poll the control, alt, and shift keys and set the
|
||||
// appropriate internal key masks.
|
||||
|
|
|
|||
|
|
@ -45,6 +45,13 @@ BOOL LLKeyboardHeadless::handleKeyUp(const U16 key, const U32 mask)
|
|||
MASK LLKeyboardHeadless::currentMask(BOOL for_mouse_event)
|
||||
{ return MASK_NONE; }
|
||||
|
||||
#ifdef LL_DARWIN
|
||||
void LLKeyboardHeadless::handleModifier(MASK mask)
|
||||
{
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
void LLKeyboardHeadless::scanKeyboard()
|
||||
{
|
||||
for (S32 key = 0; key < KEY_COUNT; key++)
|
||||
|
|
|
|||
|
|
@ -40,6 +40,9 @@ public:
|
|||
/*virtual*/ void resetMaskKeys();
|
||||
/*virtual*/ MASK currentMask(BOOL for_mouse_event);
|
||||
/*virtual*/ void scanKeyboard();
|
||||
#ifdef LL_DARWIN
|
||||
/*virtual*/ void handleModifier(MASK mask);
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -198,6 +198,11 @@ static BOOL translateKeyMac(const U16 key, const U32 mask, KEY &outKey, U32 &out
|
|||
}
|
||||
*/
|
||||
|
||||
void LLKeyboardMacOSX::handleModifier(MASK mask)
|
||||
{
|
||||
updateModifiers(mask);
|
||||
}
|
||||
|
||||
MASK LLKeyboardMacOSX::updateModifiers(const U32 mask)
|
||||
{
|
||||
// translate the mask
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ public:
|
|||
/*virtual*/ void resetMaskKeys();
|
||||
/*virtual*/ MASK currentMask(BOOL for_mouse_event);
|
||||
/*virtual*/ void scanKeyboard();
|
||||
/*virtual*/ void handleModifier(MASK mask);
|
||||
|
||||
protected:
|
||||
MASK updateModifiers(const U32 mask);
|
||||
|
|
|
|||
|
|
@ -345,6 +345,7 @@
|
|||
|
||||
- (void)flagsChanged:(NSEvent *)theEvent {
|
||||
mModifiers = [theEvent modifierFlags];
|
||||
callModifier([theEvent modifierFlags]);
|
||||
}
|
||||
|
||||
- (void) mouseDown:(NSEvent *)theEvent
|
||||
|
|
@ -433,8 +434,6 @@
|
|||
callMouseExit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (NSPoint)convertToScreenFromLocalPoint:(NSPoint)point relativeToView:(NSView *)view
|
||||
{
|
||||
NSScreen *currentScreen = [NSScreen currentScreenForMouseLocation];
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ void callMiddleMouseDown(float *pos, unsigned int mask);
|
|||
void callMiddleMouseUp(float *pos, unsigned int mask);
|
||||
void callFocus();
|
||||
void callFocusLost();
|
||||
void callModifier(unsigned int mask);
|
||||
|
||||
#include <string>
|
||||
void callHandleDragEntered(std::string url);
|
||||
|
|
|
|||
|
|
@ -337,6 +337,11 @@ void callMiddleMouseUp(float *pos, MASK mask)
|
|||
gWindowImplementation->getCallbacks()->handleMiddleMouseUp(gWindowImplementation, outCoords, mask);
|
||||
}
|
||||
|
||||
void callModifier(MASK mask)
|
||||
{
|
||||
gKeyboard->handleModifier(mask);
|
||||
}
|
||||
|
||||
void callHandleDragEntered(std::string url)
|
||||
{
|
||||
gWindowImplementation->handleDragNDrop(url, LLWindowCallbacks::DNDA_START_TRACKING);
|
||||
|
|
|
|||
Loading…
Reference in New Issue