mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1009388 part.2 Accessible should use WidgetEvent::AccelModifier() for consistency with other modules r=smaug+surkov.alexander
This commit is contained in:
parent
442e0f0f31
commit
066f82fb48
@ -76,6 +76,7 @@
|
||||
#endif
|
||||
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/BasicEvents.h"
|
||||
#include "mozilla/EventStates.h"
|
||||
#include "mozilla/FloatingPoint.h"
|
||||
#include "mozilla/MouseEvents.h"
|
||||
@ -3264,6 +3265,25 @@ Accessible::StaticAsserts() const
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// KeyBinding class
|
||||
|
||||
// static
|
||||
uint32_t
|
||||
KeyBinding::AccelModifier()
|
||||
{
|
||||
switch (WidgetInputEvent::AccelModifier()) {
|
||||
case MODIFIER_ALT:
|
||||
return kAlt;
|
||||
case MODIFIER_CONTROL:
|
||||
return kControl;
|
||||
case MODIFIER_META:
|
||||
return kMeta;
|
||||
case MODIFIER_OS:
|
||||
return kOS;
|
||||
default:
|
||||
MOZ_CRASH("Handle the new result of WidgetInputEvent::AccelModifier()");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
KeyBinding::ToPlatformFormat(nsAString& aValue) const
|
||||
{
|
||||
|
@ -1066,6 +1066,8 @@ public:
|
||||
static const uint32_t kMeta = 8;
|
||||
static const uint32_t kOS = 16;
|
||||
|
||||
static uint32_t AccelModifier();
|
||||
|
||||
KeyBinding() : mKey(0), mModifierMask(0) {}
|
||||
KeyBinding(uint32_t aKey, uint32_t aModifierMask) :
|
||||
mKey(aKey), mModifierMask(aModifierMask) {}
|
||||
|
@ -233,31 +233,7 @@ XULMenuitemAccessible::KeyboardShortcut() const
|
||||
if (modifiersStr.Find("control") != -1)
|
||||
modifierMask |= KeyBinding::kControl;
|
||||
if (modifiersStr.Find("accel") != -1) {
|
||||
// Get the accelerator key value from prefs, overriding the default.
|
||||
switch (Preferences::GetInt("ui.key.accelKey", 0)) {
|
||||
case nsIDOMKeyEvent::DOM_VK_META:
|
||||
modifierMask |= KeyBinding::kMeta;
|
||||
break;
|
||||
|
||||
case nsIDOMKeyEvent::DOM_VK_WIN:
|
||||
modifierMask |= KeyBinding::kOS;
|
||||
break;
|
||||
|
||||
case nsIDOMKeyEvent::DOM_VK_ALT:
|
||||
modifierMask |= KeyBinding::kAlt;
|
||||
break;
|
||||
|
||||
case nsIDOMKeyEvent::DOM_VK_CONTROL:
|
||||
modifierMask |= KeyBinding::kControl;
|
||||
break;
|
||||
|
||||
default:
|
||||
#ifdef XP_MACOSX
|
||||
modifierMask |= KeyBinding::kMeta;
|
||||
#else
|
||||
modifierMask |= KeyBinding::kControl;
|
||||
#endif
|
||||
}
|
||||
modifierMask |= KeyBinding::AccelModifier();
|
||||
}
|
||||
|
||||
return KeyBinding(key, modifierMask);
|
||||
|
Loading…
Reference in New Issue
Block a user