2013-09-24 14:04:16 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#include "mozilla/BasicEvents.h"
|
2013-10-18 10:10:20 +04:00
|
|
|
#include "mozilla/ContentEvents.h"
|
2014-02-27 14:51:15 +04:00
|
|
|
#include "mozilla/InternalMutationEvent.h"
|
2013-09-24 14:04:16 +04:00
|
|
|
#include "mozilla/MiscEvents.h"
|
|
|
|
#include "mozilla/MouseEvents.h"
|
2014-05-22 08:06:05 +04:00
|
|
|
#include "mozilla/Preferences.h"
|
2013-10-18 10:10:20 +04:00
|
|
|
#include "mozilla/TextEvents.h"
|
|
|
|
#include "mozilla/TouchEvents.h"
|
2013-09-24 14:04:16 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
2013-10-18 10:10:20 +04:00
|
|
|
/******************************************************************************
|
|
|
|
* As*Event() implementation
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
#define NS_ROOT_EVENT_CLASS(aPrefix, aName)
|
|
|
|
#define NS_EVENT_CLASS(aPrefix, aName) \
|
|
|
|
aPrefix##aName* \
|
|
|
|
WidgetEvent::As##aName() \
|
|
|
|
{ \
|
|
|
|
return nullptr; \
|
|
|
|
} \
|
|
|
|
\
|
|
|
|
const aPrefix##aName* \
|
|
|
|
WidgetEvent::As##aName() const \
|
|
|
|
{ \
|
|
|
|
return const_cast<WidgetEvent*>(this)->As##aName(); \
|
|
|
|
}
|
|
|
|
|
|
|
|
#include "mozilla/EventClassList.h"
|
|
|
|
|
|
|
|
#undef NS_EVENT_CLASS
|
|
|
|
#undef NS_ROOT_EVENT_CLASS
|
|
|
|
|
2013-09-24 14:04:16 +04:00
|
|
|
/******************************************************************************
|
|
|
|
* mozilla::WidgetEvent
|
|
|
|
*
|
|
|
|
* Event struct type checking methods.
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
bool
|
|
|
|
WidgetEvent::IsQueryContentEvent() const
|
|
|
|
{
|
2014-08-04 09:28:49 +04:00
|
|
|
return mClass == eQueryContentEventClass;
|
2013-09-24 14:04:16 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
WidgetEvent::IsSelectionEvent() const
|
|
|
|
{
|
2014-08-04 09:28:49 +04:00
|
|
|
return mClass == eSelectionEventClass;
|
2013-09-24 14:04:16 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
WidgetEvent::IsContentCommandEvent() const
|
|
|
|
{
|
2014-08-04 09:28:56 +04:00
|
|
|
return mClass == eContentCommandEventClass;
|
2013-09-24 14:04:16 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
WidgetEvent::IsNativeEventDelivererForPlugin() const
|
|
|
|
{
|
2014-08-04 09:28:57 +04:00
|
|
|
return mClass == ePluginEventClass;
|
2013-09-24 14:04:16 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* mozilla::WidgetEvent
|
|
|
|
*
|
|
|
|
* Event message checking methods.
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
bool
|
|
|
|
WidgetEvent::HasMouseEventMessage() const
|
|
|
|
{
|
|
|
|
switch (message) {
|
|
|
|
case NS_MOUSE_BUTTON_DOWN:
|
|
|
|
case NS_MOUSE_BUTTON_UP:
|
|
|
|
case NS_MOUSE_CLICK:
|
|
|
|
case NS_MOUSE_DOUBLECLICK:
|
|
|
|
case NS_MOUSE_ENTER:
|
|
|
|
case NS_MOUSE_EXIT:
|
|
|
|
case NS_MOUSE_ACTIVATE:
|
|
|
|
case NS_MOUSE_ENTER_SYNTH:
|
|
|
|
case NS_MOUSE_EXIT_SYNTH:
|
|
|
|
case NS_MOUSE_MOZHITTEST:
|
|
|
|
case NS_MOUSE_MOVE:
|
|
|
|
return true;
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
WidgetEvent::HasDragEventMessage() const
|
|
|
|
{
|
|
|
|
switch (message) {
|
|
|
|
case NS_DRAGDROP_ENTER:
|
|
|
|
case NS_DRAGDROP_OVER:
|
|
|
|
case NS_DRAGDROP_EXIT:
|
|
|
|
case NS_DRAGDROP_DRAGDROP:
|
|
|
|
case NS_DRAGDROP_GESTURE:
|
|
|
|
case NS_DRAGDROP_DRAG:
|
|
|
|
case NS_DRAGDROP_END:
|
|
|
|
case NS_DRAGDROP_START:
|
|
|
|
case NS_DRAGDROP_DROP:
|
|
|
|
case NS_DRAGDROP_LEAVE_SYNTH:
|
|
|
|
return true;
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
WidgetEvent::HasKeyEventMessage() const
|
|
|
|
{
|
|
|
|
switch (message) {
|
|
|
|
case NS_KEY_DOWN:
|
|
|
|
case NS_KEY_PRESS:
|
|
|
|
case NS_KEY_UP:
|
2014-11-03 10:05:12 +03:00
|
|
|
case NS_KEY_BEFORE_DOWN:
|
|
|
|
case NS_KEY_BEFORE_UP:
|
|
|
|
case NS_KEY_AFTER_DOWN:
|
|
|
|
case NS_KEY_AFTER_UP:
|
2013-09-24 14:04:16 +04:00
|
|
|
return true;
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
WidgetEvent::HasIMEEventMessage() const
|
|
|
|
{
|
|
|
|
switch (message) {
|
|
|
|
case NS_COMPOSITION_START:
|
|
|
|
case NS_COMPOSITION_END:
|
|
|
|
case NS_COMPOSITION_UPDATE:
|
2014-10-07 14:01:47 +04:00
|
|
|
case NS_COMPOSITION_CHANGE:
|
2014-11-25 08:02:31 +03:00
|
|
|
case NS_COMPOSITION_COMMIT_AS_IS:
|
2014-11-25 08:02:32 +03:00
|
|
|
case NS_COMPOSITION_COMMIT:
|
2013-09-24 14:04:16 +04:00
|
|
|
return true;
|
|
|
|
default:
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
WidgetEvent::HasPluginActivationEventMessage() const
|
|
|
|
{
|
|
|
|
return message == NS_PLUGIN_ACTIVATE ||
|
|
|
|
message == NS_PLUGIN_FOCUS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* mozilla::WidgetEvent
|
|
|
|
*
|
|
|
|
* Specific event checking methods.
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
bool
|
|
|
|
WidgetEvent::IsRetargetedNativeEventDelivererForPlugin() const
|
|
|
|
{
|
2013-10-18 10:10:20 +04:00
|
|
|
const WidgetPluginEvent* pluginEvent = AsPluginEvent();
|
|
|
|
return pluginEvent && pluginEvent->retargetToFocusedDocument;
|
2013-09-24 14:04:16 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
WidgetEvent::IsNonRetargetedNativeEventDelivererForPlugin() const
|
|
|
|
{
|
2013-10-18 10:10:20 +04:00
|
|
|
const WidgetPluginEvent* pluginEvent = AsPluginEvent();
|
|
|
|
return pluginEvent && !pluginEvent->retargetToFocusedDocument;
|
2013-09-24 14:04:16 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
WidgetEvent::IsIMERelatedEvent() const
|
|
|
|
{
|
|
|
|
return HasIMEEventMessage() || IsQueryContentEvent() || IsSelectionEvent();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
WidgetEvent::IsUsingCoordinates() const
|
|
|
|
{
|
2013-10-28 13:03:19 +04:00
|
|
|
const WidgetMouseEvent* mouseEvent = AsMouseEvent();
|
|
|
|
if (mouseEvent) {
|
|
|
|
return !mouseEvent->IsContextMenuKeyEvent();
|
|
|
|
}
|
2013-09-24 14:04:16 +04:00
|
|
|
return !HasKeyEventMessage() && !IsIMERelatedEvent() &&
|
|
|
|
!HasPluginActivationEventMessage() &&
|
|
|
|
!IsNativeEventDelivererForPlugin() &&
|
2014-12-11 17:44:07 +03:00
|
|
|
!IsContentCommandEvent();
|
2013-09-24 14:04:16 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
WidgetEvent::IsTargetedAtFocusedWindow() const
|
|
|
|
{
|
2013-10-28 13:03:19 +04:00
|
|
|
const WidgetMouseEvent* mouseEvent = AsMouseEvent();
|
|
|
|
if (mouseEvent) {
|
|
|
|
return mouseEvent->IsContextMenuKeyEvent();
|
|
|
|
}
|
2013-09-24 14:04:16 +04:00
|
|
|
return HasKeyEventMessage() || IsIMERelatedEvent() ||
|
|
|
|
IsContentCommandEvent() ||
|
|
|
|
IsRetargetedNativeEventDelivererForPlugin();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
WidgetEvent::IsTargetedAtFocusedContent() const
|
|
|
|
{
|
2013-10-28 13:03:19 +04:00
|
|
|
const WidgetMouseEvent* mouseEvent = AsMouseEvent();
|
|
|
|
if (mouseEvent) {
|
|
|
|
return mouseEvent->IsContextMenuKeyEvent();
|
|
|
|
}
|
2013-09-24 14:04:16 +04:00
|
|
|
return HasKeyEventMessage() || IsIMERelatedEvent() ||
|
|
|
|
IsRetargetedNativeEventDelivererForPlugin();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
WidgetEvent::IsAllowedToDispatchDOMEvent() const
|
|
|
|
{
|
2014-08-04 09:28:46 +04:00
|
|
|
switch (mClass) {
|
2014-08-04 09:28:50 +04:00
|
|
|
case eMouseEventClass:
|
2014-08-04 09:28:52 +04:00
|
|
|
case ePointerEventClass:
|
2013-09-24 14:04:16 +04:00
|
|
|
// We want synthesized mouse moves to cause mouseover and mouseout
|
2014-04-01 08:09:23 +04:00
|
|
|
// DOM events (EventStateManager::PreHandleEvent), but not mousemove
|
2013-09-24 14:04:16 +04:00
|
|
|
// DOM events.
|
|
|
|
// Synthesized button up events also do not cause DOM events because they
|
|
|
|
// do not have a reliable refPoint.
|
2013-10-18 10:10:20 +04:00
|
|
|
return AsMouseEvent()->reason == WidgetMouseEvent::eReal;
|
2013-09-24 14:04:16 +04:00
|
|
|
|
2014-08-04 09:28:51 +04:00
|
|
|
case eWheelEventClass: {
|
2013-09-24 14:04:16 +04:00
|
|
|
// wheel event whose all delta values are zero by user pref applied, it
|
|
|
|
// shouldn't cause a DOM event.
|
2013-10-18 10:10:20 +04:00
|
|
|
const WidgetWheelEvent* wheelEvent = AsWheelEvent();
|
2013-09-24 14:04:16 +04:00
|
|
|
return wheelEvent->deltaX != 0.0 || wheelEvent->deltaY != 0.0 ||
|
|
|
|
wheelEvent->deltaZ != 0.0;
|
|
|
|
}
|
|
|
|
|
2014-03-27 17:53:19 +04:00
|
|
|
// Following events are handled in EventStateManager, so, we don't need to
|
|
|
|
// dispatch DOM event for them into the DOM tree.
|
2014-08-04 09:28:49 +04:00
|
|
|
case eQueryContentEventClass:
|
2014-08-04 09:28:49 +04:00
|
|
|
case eSelectionEventClass:
|
2014-08-04 09:28:56 +04:00
|
|
|
case eContentCommandEventClass:
|
2014-03-27 17:53:19 +04:00
|
|
|
return false;
|
|
|
|
|
2013-09-24 14:04:16 +04:00
|
|
|
default:
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-05-22 08:06:05 +04:00
|
|
|
/******************************************************************************
|
|
|
|
* mozilla::WidgetInputEvent
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
/* static */
|
|
|
|
Modifier
|
|
|
|
WidgetInputEvent::AccelModifier()
|
|
|
|
{
|
|
|
|
static Modifier sAccelModifier = MODIFIER_NONE;
|
|
|
|
if (sAccelModifier == MODIFIER_NONE) {
|
|
|
|
switch (Preferences::GetInt("ui.key.accelKey", 0)) {
|
|
|
|
case nsIDOMKeyEvent::DOM_VK_META:
|
|
|
|
sAccelModifier = MODIFIER_META;
|
|
|
|
break;
|
|
|
|
case nsIDOMKeyEvent::DOM_VK_WIN:
|
|
|
|
sAccelModifier = MODIFIER_OS;
|
|
|
|
break;
|
|
|
|
case nsIDOMKeyEvent::DOM_VK_ALT:
|
|
|
|
sAccelModifier = MODIFIER_ALT;
|
|
|
|
break;
|
|
|
|
case nsIDOMKeyEvent::DOM_VK_CONTROL:
|
|
|
|
sAccelModifier = MODIFIER_CONTROL;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
#ifdef XP_MACOSX
|
|
|
|
sAccelModifier = MODIFIER_META;
|
|
|
|
#else
|
|
|
|
sAccelModifier = MODIFIER_CONTROL;
|
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return sAccelModifier;
|
|
|
|
}
|
|
|
|
|
2014-01-08 20:45:30 +04:00
|
|
|
/******************************************************************************
|
|
|
|
* mozilla::WidgetKeyboardEvent (TextEvents.h)
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
/*static*/ void
|
|
|
|
WidgetKeyboardEvent::GetDOMKeyName(KeyNameIndex aKeyNameIndex,
|
|
|
|
nsAString& aKeyName)
|
|
|
|
{
|
|
|
|
// The expected way to implement this function would be to use a
|
|
|
|
// switch statement. By using a table-based implementation, below, we
|
|
|
|
// ensure that this function executes in constant time in cases where
|
|
|
|
// compilers wouldn't be able to convert the switch statement to a
|
|
|
|
// jump table. This table-based implementation also minimizes the
|
|
|
|
// space required by the code and data.
|
|
|
|
#define KEY_STR_NUM_INTERNAL(line) key##line
|
|
|
|
#define KEY_STR_NUM(line) KEY_STR_NUM_INTERNAL(line)
|
|
|
|
|
|
|
|
// Catch non-ASCII DOM key names in our key name list.
|
|
|
|
#define NS_DEFINE_KEYNAME(aCPPName, aDOMKeyName) \
|
|
|
|
static_assert(sizeof(aDOMKeyName) == MOZ_ARRAY_LENGTH(aDOMKeyName), \
|
|
|
|
"Invalid DOM key name");
|
2014-04-01 15:42:11 +04:00
|
|
|
#include "mozilla/KeyNameList.h"
|
2014-01-08 20:45:30 +04:00
|
|
|
#undef NS_DEFINE_KEYNAME
|
|
|
|
|
|
|
|
struct KeyNameTable
|
|
|
|
{
|
|
|
|
#define NS_DEFINE_KEYNAME(aCPPName, aDOMKeyName) \
|
|
|
|
char16_t KEY_STR_NUM(__LINE__)[sizeof(aDOMKeyName)];
|
2014-04-01 15:42:11 +04:00
|
|
|
#include "mozilla/KeyNameList.h"
|
2014-01-08 20:45:30 +04:00
|
|
|
#undef NS_DEFINE_KEYNAME
|
|
|
|
};
|
|
|
|
|
|
|
|
static const KeyNameTable kKeyNameTable = {
|
|
|
|
#define NS_DEFINE_KEYNAME(aCPPName, aDOMKeyName) MOZ_UTF16(aDOMKeyName),
|
2014-04-01 15:42:11 +04:00
|
|
|
#include "mozilla/KeyNameList.h"
|
2014-01-08 20:45:30 +04:00
|
|
|
#undef NS_DEFINE_KEYNAME
|
|
|
|
};
|
|
|
|
|
|
|
|
static const uint16_t kKeyNameOffsets[] = {
|
|
|
|
#define NS_DEFINE_KEYNAME(aCPPName, aDOMKeyName) \
|
2014-01-21 20:41:24 +04:00
|
|
|
offsetof(struct KeyNameTable, KEY_STR_NUM(__LINE__)) / sizeof(char16_t),
|
2014-04-01 15:42:11 +04:00
|
|
|
#include "mozilla/KeyNameList.h"
|
2014-01-08 20:45:30 +04:00
|
|
|
#undef NS_DEFINE_KEYNAME
|
|
|
|
// Include this entry so we can compute lengths easily.
|
|
|
|
sizeof(kKeyNameTable)
|
|
|
|
};
|
|
|
|
|
|
|
|
// Use the sizeof trick rather than MOZ_ARRAY_LENGTH to avoid problems
|
|
|
|
// with constexpr functions called inside static_assert with some
|
|
|
|
// compilers.
|
|
|
|
static_assert(KEY_NAME_INDEX_USE_STRING ==
|
|
|
|
(sizeof(kKeyNameOffsets)/sizeof(kKeyNameOffsets[0])) - 1,
|
|
|
|
"Invalid enumeration values!");
|
|
|
|
|
|
|
|
if (aKeyNameIndex >= KEY_NAME_INDEX_USE_STRING) {
|
|
|
|
aKeyName.Truncate();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint16_t offset = kKeyNameOffsets[aKeyNameIndex];
|
|
|
|
uint16_t nextOffset = kKeyNameOffsets[aKeyNameIndex + 1];
|
|
|
|
const char16_t* table = reinterpret_cast<const char16_t*>(&kKeyNameTable);
|
|
|
|
|
|
|
|
// Subtract off 1 for the null terminator.
|
|
|
|
aKeyName.Assign(table + offset, nextOffset - offset - 1);
|
|
|
|
|
|
|
|
#undef KEY_STR_NUM
|
|
|
|
#undef KEY_STR_NUM_INTERNAL
|
|
|
|
}
|
|
|
|
|
2014-05-25 06:08:58 +04:00
|
|
|
/*static*/ void
|
|
|
|
WidgetKeyboardEvent::GetDOMCodeName(CodeNameIndex aCodeNameIndex,
|
|
|
|
nsAString& aCodeName)
|
|
|
|
{
|
|
|
|
if (aCodeNameIndex >= CODE_NAME_INDEX_USE_STRING) {
|
|
|
|
aCodeName.Truncate();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
#define NS_DEFINE_PHYSICAL_KEY_CODE_NAME(aCPPName, aDOMCodeName) \
|
|
|
|
MOZ_UTF16(aDOMCodeName),
|
|
|
|
static const char16_t* kCodeNames[] = {
|
|
|
|
#include "mozilla/PhysicalKeyCodeNameList.h"
|
|
|
|
MOZ_UTF16("")
|
|
|
|
};
|
|
|
|
#undef NS_DEFINE_PHYSICAL_KEY_CODE_NAME
|
|
|
|
|
|
|
|
MOZ_RELEASE_ASSERT(static_cast<size_t>(aCodeNameIndex) <
|
|
|
|
ArrayLength(kCodeNames),
|
|
|
|
"Illegal physical code enumeration value");
|
|
|
|
aCodeName = kCodeNames[aCodeNameIndex];
|
|
|
|
}
|
|
|
|
|
2014-03-14 17:13:30 +04:00
|
|
|
/* static */ const char*
|
|
|
|
WidgetKeyboardEvent::GetCommandStr(Command aCommand)
|
|
|
|
{
|
|
|
|
#define NS_DEFINE_COMMAND(aName, aCommandStr) , #aCommandStr
|
|
|
|
static const char* kCommands[] = {
|
|
|
|
"" // CommandDoNothing
|
|
|
|
#include "mozilla/CommandList.h"
|
|
|
|
};
|
|
|
|
#undef NS_DEFINE_COMMAND
|
|
|
|
|
|
|
|
MOZ_RELEASE_ASSERT(static_cast<size_t>(aCommand) < ArrayLength(kCommands),
|
|
|
|
"Illegal command enumeration value");
|
|
|
|
return kCommands[aCommand];
|
|
|
|
}
|
|
|
|
|
2015-01-28 16:36:53 +03:00
|
|
|
/* static */ uint32_t
|
|
|
|
WidgetKeyboardEvent::ComputeLocationFromCodeValue(CodeNameIndex aCodeNameIndex)
|
|
|
|
{
|
|
|
|
// Following commented out cases are not defined in PhysicalKeyCodeNameList.h
|
|
|
|
// but are defined by D3E spec. So, they should be uncommented when the
|
|
|
|
// code values are defined in the header.
|
|
|
|
switch (aCodeNameIndex) {
|
|
|
|
case CODE_NAME_INDEX_AltLeft:
|
|
|
|
case CODE_NAME_INDEX_ControlLeft:
|
|
|
|
case CODE_NAME_INDEX_OSLeft:
|
|
|
|
case CODE_NAME_INDEX_ShiftLeft:
|
|
|
|
return nsIDOMKeyEvent::DOM_KEY_LOCATION_LEFT;
|
|
|
|
case CODE_NAME_INDEX_AltRight:
|
|
|
|
case CODE_NAME_INDEX_ControlRight:
|
|
|
|
case CODE_NAME_INDEX_OSRight:
|
|
|
|
case CODE_NAME_INDEX_ShiftRight:
|
|
|
|
return nsIDOMKeyEvent::DOM_KEY_LOCATION_RIGHT;
|
|
|
|
case CODE_NAME_INDEX_Numpad0:
|
|
|
|
case CODE_NAME_INDEX_Numpad1:
|
|
|
|
case CODE_NAME_INDEX_Numpad2:
|
|
|
|
case CODE_NAME_INDEX_Numpad3:
|
|
|
|
case CODE_NAME_INDEX_Numpad4:
|
|
|
|
case CODE_NAME_INDEX_Numpad5:
|
|
|
|
case CODE_NAME_INDEX_Numpad6:
|
|
|
|
case CODE_NAME_INDEX_Numpad7:
|
|
|
|
case CODE_NAME_INDEX_Numpad8:
|
|
|
|
case CODE_NAME_INDEX_Numpad9:
|
|
|
|
case CODE_NAME_INDEX_NumpadAdd:
|
|
|
|
case CODE_NAME_INDEX_NumpadBackspace:
|
|
|
|
// case CODE_NAME_INDEX_NumpadClear:
|
|
|
|
// case CODE_NAME_INDEX_NumpadClearEntry:
|
|
|
|
case CODE_NAME_INDEX_NumpadComma:
|
|
|
|
case CODE_NAME_INDEX_NumpadDecimal:
|
|
|
|
case CODE_NAME_INDEX_NumpadDivide:
|
|
|
|
case CODE_NAME_INDEX_NumpadEnter:
|
|
|
|
case CODE_NAME_INDEX_NumpadEqual:
|
|
|
|
// case CODE_NAME_INDEX_NumpadMemoryAdd:
|
|
|
|
// case CODE_NAME_INDEX_NumpadMemoryClear:
|
|
|
|
// case CODE_NAME_INDEX_NumpadMemoryRecall:
|
|
|
|
// case CODE_NAME_INDEX_NumpadMemoryStore:
|
|
|
|
case CODE_NAME_INDEX_NumpadMemorySubtract:
|
|
|
|
case CODE_NAME_INDEX_NumpadMultiply:
|
|
|
|
// case CODE_NAME_INDEX_NumpadParenLeft:
|
|
|
|
// case CODE_NAME_INDEX_NumpadParenRight:
|
|
|
|
case CODE_NAME_INDEX_NumpadSubtract:
|
|
|
|
return nsIDOMKeyEvent::DOM_KEY_LOCATION_NUMPAD;
|
|
|
|
default:
|
|
|
|
return nsIDOMKeyEvent::DOM_KEY_LOCATION_STANDARD;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-09-24 14:04:16 +04:00
|
|
|
} // namespace mozilla
|