diff options
author | Mnikolenko ProductEngine <mnikolenko@productengine.com> | 2014-04-08 12:37:41 +0300 |
---|---|---|
committer | Mnikolenko ProductEngine <mnikolenko@productengine.com> | 2014-04-08 12:37:41 +0300 |
commit | 1108a34d1dc063eddf2b0e4991b6391a12686be7 (patch) | |
tree | 87d1dc5c0c2a74b3aae2036e382a11d242ee6e1f /indra/llwindow/llopenglview-objc.mm | |
parent | 45651fda5a9b0ace8ef580751304b704a7fd9152 (diff) |
MAINT-3907 FIXED Handle pressing of Alt/Shift/Control keys without any other key being pressed simultaneously.
Diffstat (limited to 'indra/llwindow/llopenglview-objc.mm')
-rw-r--r-- | indra/llwindow/llopenglview-objc.mm | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index 017ea3769c..f7031341eb 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -398,9 +398,35 @@ attributedStringInfo getSegments(NSAttributedString *str) } } -- (void)flagsChanged:(NSEvent *)theEvent { +- (void)flagsChanged:(NSEvent *)theEvent +{ mModifiers = [theEvent modifierFlags]; callModifier([theEvent modifierFlags]); + + NSInteger mask = 0; + switch([theEvent keyCode]) + { + case 56: + mask = NSShiftKeyMask; + break; + case 58: + mask = NSAlternateKeyMask; + break; + case 59: + mask = NSControlKeyMask; + break; + default: + return; + } + + if (mModifiers & mask) + { + callKeyDown([theEvent keyCode], 0); + } + else + { + callKeyUp([theEvent keyCode], 0); + } } - (BOOL) acceptsFirstResponder |