From f9a2d0f71fa61d7b71ca035828684d0ebc3d6e6a Mon Sep 17 00:00:00 2001 From: "pinkerton%netscape.com" Date: Thu, 29 Oct 1998 23:47:05 +0000 Subject: [PATCH] don't process menu events multiple times (do them only on keydown). --- widget/src/mac/nsMacMessagePump.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/widget/src/mac/nsMacMessagePump.cpp b/widget/src/mac/nsMacMessagePump.cpp index 1a3df4834e3a..c104769530a2 100644 --- a/widget/src/mac/nsMacMessagePump.cpp +++ b/widget/src/mac/nsMacMessagePump.cpp @@ -329,12 +329,14 @@ void nsMacMessagePump::DoMouseMove(EventRecord &anEvent) //------------------------------------------------------------------------- // // DoKey -// +// +// This is called for keydown, keyup, and key repeating events. So we need +// to be careful not to do things twice. //------------------------------------------------------------------------- void nsMacMessagePump::DoKey(EventRecord &anEvent) { char theChar = (char)(anEvent.message & charCodeMask); - if (anEvent.modifiers & cmdKey) + if ( (anEvent.what == keyDown) && ((anEvent.modifiers & cmdKey) != 0) ) { // do a menu key command long menuResult = ::MenuKey(theChar);