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:
Robert Osfield 2009-05-28 14:09:16 +00:00
parent f0b55bbdb3
commit f80033d892

View File

@ -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