different approach for fixing 363002. b=363002 r=mento

This commit is contained in:
joshmoz%gmail.com 2006-12-11 21:40:32 +00:00
Родитель 4ca00294c6
Коммит 6fc4e63f30
1 изменённых файлов: 9 добавлений и 4 удалений

Просмотреть файл

@ -3627,16 +3627,21 @@ static void ConvertCocoaKeyEventToMacEvent(NSEvent* cocoaEvent, EventRecord& mac
- (BOOL)performKeyEquivalent:(NSEvent*)theEvent
{
// Don't bother if we're in composition. Also do not handle anything
// that isn't a key down event. Some keys like arrow keys send command
// events for up and down, and we only care about down. See bug 363002.
if (mInComposition || ([theEvent type] != NSKeyDown))
// don't bother if we're in composition
if (mInComposition)
return NO;
// see if the menu system will handle the event
if ([[NSApp mainMenu] performKeyEquivalent:theEvent])
return YES;
// don't handle this if certain modifiers are down - those should
// be sent as normal key up/down events and cocoa will do so automatically
// if we reject here
unsigned int modifierFlags = [theEvent modifierFlags];
if ((modifierFlags & NSFunctionKeyMask) || (modifierFlags & NSNumericPadKeyMask))
return NO;
// handle the event ourselves
nsKeyEvent geckoEvent(PR_TRUE, 0, nsnull);
geckoEvent.refPoint.x = geckoEvent.refPoint.y = 0;