From Stephan Huber, "attached you'll find a small fix for GrphicsWindowCocoa. There was a bug
with certain key-strokes, which led to a crash."
This commit is contained in:
parent
f0b55bbdb3
commit
f80033d892
@ -669,10 +669,12 @@ static NSRect convertToQuartzCoordinates(const NSRect& rect)
|
||||
if (!_win) return;
|
||||
|
||||
NSString* chars = [theEvent charactersIgnoringModifiers];
|
||||
if ((chars) && ([chars length] > 0)) {
|
||||
unsigned int keyCode = remapCocoaKey([chars characterAtIndex:0], ([theEvent modifierFlags] & NSFunctionKeyMask) );
|
||||
// std::cout << "key dn: " <<[chars characterAtIndex:0] << "=" << keyCode << std::endl;
|
||||
_win->getEventQueue()->keyPress( remapCocoaKey(keyCode), [theEvent timestamp]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (void)keyUp:(NSEvent *)theEvent
|
||||
@ -680,10 +682,12 @@ static NSRect convertToQuartzCoordinates(const NSRect& rect)
|
||||
if (!_win) return;
|
||||
|
||||
NSString* chars = [theEvent charactersIgnoringModifiers];
|
||||
if ((chars) && ([chars length] > 0)) {
|
||||
unsigned int keyCode = remapCocoaKey([chars characterAtIndex:0], ([theEvent modifierFlags] & NSFunctionKeyMask));
|
||||
// std::cout << "key up: " <<[chars characterAtIndex:0] << "=" << keyCode << std::endl;
|
||||
_win->getEventQueue()->keyRelease( remapCocoaKey(keyCode), [theEvent timestamp]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (void)tabletPoint:(NSEvent *)theEvent
|
||||
|
Loading…
Reference in New Issue
Block a user