From 635860845790a19bf50bbc51ba8fb66a96dde068 Mon Sep 17 00:00:00 2001 From: The Android Open Source Project Date: Thu, 5 Mar 2009 14:34:32 -0800 Subject: auto import from //depot/cupcake/@136594 --- WebCore/page/mac/EventHandlerMac.mm | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'WebCore/page/mac/EventHandlerMac.mm') diff --git a/WebCore/page/mac/EventHandlerMac.mm b/WebCore/page/mac/EventHandlerMac.mm index 562c1dd..5d09843 100644 --- a/WebCore/page/mac/EventHandlerMac.mm +++ b/WebCore/page/mac/EventHandlerMac.mm @@ -26,6 +26,7 @@ #include "config.h" #include "EventHandler.h" +#include "AXObjectCache.h" #include "BlockExceptions.h" #include "ChromeClient.h" #include "ClipboardMac.h" @@ -42,16 +43,15 @@ #include "RenderWidget.h" #include "Scrollbar.h" #include "Settings.h" +#include namespace WebCore { -unsigned EventHandler::s_accessKeyModifiers = PlatformKeyboardEvent::CtrlKey | PlatformKeyboardEvent::AltKey; - const double EventHandler::TextDragDelay = 0.15; static RetainPtr& currentEvent() { - static RetainPtr event; + DEFINE_STATIC_LOCAL(RetainPtr, event, ()); return event; } @@ -643,4 +643,15 @@ bool EventHandler::passMouseReleaseEventToSubframe(MouseEventWithHitTestResults& return passSubframeEventToSubframe(mev, subframe); } +unsigned EventHandler::accessKeyModifiers() +{ + // Control+Option key combinations are usually unused on Mac OS X, but not when VoiceOver is enabled. + // So, we use Control in this case, even though it conflicts with Emacs-style key bindings. + // See for more detail. + if (AXObjectCache::accessibilityEnhancedUserInterfaceEnabled()) + return PlatformKeyboardEvent::CtrlKey; + + return PlatformKeyboardEvent::CtrlKey | PlatformKeyboardEvent::AltKey; +} + } -- cgit v1.1