本文整理汇总了C++中PlatformKeyboardEvent::isKeypad方法的典型用法代码示例。如果您正苦于以下问题:C++ PlatformKeyboardEvent::isKeypad方法的具体用法?C++ PlatformKeyboardEvent::isKeypad怎么用?C++ PlatformKeyboardEvent::isKeypad使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlatformKeyboardEvent
的用法示例。
在下文中一共展示了PlatformKeyboardEvent::isKeypad方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UIEventWithKeyState
KeyboardEvent::KeyboardEvent(const PlatformKeyboardEvent& key, AbstractView* view)
: UIEventWithKeyState(eventTypeForKeyboardEventType(key.type()),
true, true, view, 0, key.ctrlKey(), key.altKey(), key.shiftKey(), key.metaKey())
, m_keyEvent(adoptPtr(new PlatformKeyboardEvent(key)))
, m_keyIdentifier(key.keyIdentifier())
, m_keyLocation(key.isKeypad() ? DOM_KEY_LOCATION_NUMPAD : DOM_KEY_LOCATION_STANDARD) // FIXME: differentiate right/left, too
, m_altGraphKey(false)
{
}
示例2: keyLocationCode
static inline KeyboardEvent::KeyLocationCode keyLocationCode(const PlatformKeyboardEvent& key)
{
if (key.isKeypad())
return KeyboardEvent::DOM_KEY_LOCATION_NUMPAD;
if (key.modifiers() & PlatformEvent::IsLeft)
return KeyboardEvent::DOM_KEY_LOCATION_LEFT;
if (key.modifiers() & PlatformEvent::IsRight)
return KeyboardEvent::DOM_KEY_LOCATION_RIGHT;
return KeyboardEvent::DOM_KEY_LOCATION_STANDARD;
}
示例3: keyLocationCode
static inline KeyboardEvent::KeyLocationCode keyLocationCode(const PlatformKeyboardEvent& key)
{
if (key.isKeypad())
return KeyboardEvent::DOM_KEY_LOCATION_NUMPAD;
switch (key.windowsVirtualKeyCode()) {
case VK_LCONTROL:
case VK_LSHIFT:
case VK_LMENU:
case VK_LWIN:
return KeyboardEvent::DOM_KEY_LOCATION_LEFT;
case VK_RCONTROL:
case VK_RSHIFT:
case VK_RMENU:
case VK_RWIN:
return KeyboardEvent::DOM_KEY_LOCATION_RIGHT;
default:
return KeyboardEvent::DOM_KEY_LOCATION_STANDARD;
}
}