本文整理汇总了C++中PlatformMouseEvent::type方法的典型用法代码示例。如果您正苦于以下问题:C++ PlatformMouseEvent::type方法的具体用法?C++ PlatformMouseEvent::type怎么用?C++ PlatformMouseEvent::type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlatformMouseEvent
的用法示例。
在下文中一共展示了PlatformMouseEvent::type方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleMouseEvent
bool InspectorController::handleMouseEvent(Frame* frame, const PlatformMouseEvent& event)
{
if (event.type() == PlatformEvent::MouseMoved) {
m_domAgent->handleMouseMove(frame, event);
return false;
}
if (event.type() == PlatformEvent::MousePressed)
return m_domAgent->handleMousePress();
return false;
}
示例2: handleInputEvent
bool InspectorOverlay::handleInputEvent(const WebInputEvent& inputEvent)
{
bool handled = false;
if (isEmpty())
return false;
if (WebInputEvent::isGestureEventType(inputEvent.type) && inputEvent.type == WebInputEvent::GestureTap) {
// Only let GestureTab in (we only need it and we know PlatformGestureEventBuilder supports it).
PlatformGestureEvent gestureEvent = PlatformGestureEventBuilder(m_webViewImpl->mainFrameImpl()->frameView(), static_cast<const WebGestureEvent&>(inputEvent));
handled = handleGestureEvent(gestureEvent);
if (handled)
return true;
overlayMainFrame()->eventHandler().handleGestureEvent(gestureEvent);
}
if (WebInputEvent::isMouseEventType(inputEvent.type) && inputEvent.type != WebInputEvent::MouseEnter) {
// PlatformMouseEventBuilder does not work with MouseEnter type, so we filter it out manually.
PlatformMouseEvent mouseEvent = PlatformMouseEventBuilder(m_webViewImpl->mainFrameImpl()->frameView(), static_cast<const WebMouseEvent&>(inputEvent));
if (mouseEvent.type() == PlatformEvent::MouseMoved)
handled = handleMouseMove(mouseEvent);
else if (mouseEvent.type() == PlatformEvent::MousePressed)
handled = handleMousePress();
if (handled)
return true;
if (mouseEvent.type() == PlatformEvent::MouseMoved)
handled = overlayMainFrame()->eventHandler().handleMouseMoveEvent(mouseEvent) != WebInputEventResult::NotHandled;
if (mouseEvent.type() == PlatformEvent::MousePressed)
handled = overlayMainFrame()->eventHandler().handleMousePressEvent(mouseEvent) != WebInputEventResult::NotHandled;
if (mouseEvent.type() == PlatformEvent::MouseReleased)
handled = overlayMainFrame()->eventHandler().handleMouseReleaseEvent(mouseEvent) != WebInputEventResult::NotHandled;
}
if (WebInputEvent::isTouchEventType(inputEvent.type)) {
PlatformTouchEvent touchEvent = PlatformTouchEventBuilder(m_webViewImpl->mainFrameImpl()->frameView(), static_cast<const WebTouchEvent&>(inputEvent));
handled = handleTouchEvent(touchEvent);
if (handled)
return true;
overlayMainFrame()->eventHandler().handleTouchEvent(touchEvent);
}
if (WebInputEvent::isKeyboardEventType(inputEvent.type)) {
PlatformKeyboardEvent keyboardEvent = PlatformKeyboardEventBuilder(static_cast<const WebKeyboardEvent&>(inputEvent));
overlayMainFrame()->eventHandler().keyEvent(keyboardEvent);
}
if (inputEvent.type == WebInputEvent::MouseWheel) {
PlatformWheelEvent wheelEvent = PlatformWheelEventBuilder(m_webViewImpl->mainFrameImpl()->frameView(), static_cast<const WebMouseWheelEvent&>(inputEvent));
handled = overlayMainFrame()->eventHandler().handleWheelEvent(wheelEvent) != WebInputEventResult::NotHandled;
}
return handled;
}
示例3: handleMouseEvent
bool WebDevToolsAgentImpl::handleMouseEvent(LocalFrame* frame, const PlatformMouseEvent& event)
{
if (event.type() == PlatformEvent::MouseMoved) {
if (InspectorDOMAgent* domAgent = m_instrumentingAgents->inspectorDOMAgent())
return domAgent->handleMouseMove(frame, event);
return false;
}
if (event.type() == PlatformEvent::MousePressed) {
if (InspectorDOMAgent* domAgent = m_instrumentingAgents->inspectorDOMAgent())
return domAgent->handleMousePress();
}
return false;
}
示例4: handleMouseEvent
bool InspectorController::handleMouseEvent(LocalFrame* frame, const PlatformMouseEvent& event)
{
// Overlay should not consume events.
m_overlay->handleMouseEvent(event);
if (event.type() == PlatformEvent::MouseMoved) {
if (InspectorDOMAgent* domAgent = m_instrumentingAgents->inspectorDOMAgent())
return domAgent->handleMouseMove(frame, event);
return false;
}
if (event.type() == PlatformEvent::MousePressed) {
if (InspectorDOMAgent* domAgent = m_instrumentingAgents->inspectorDOMAgent())
return domAgent->handleMousePress();
}
return false;
}
示例5: mouseEvent
virtual bool mouseEvent(WebPageOverlay& pageOverlay, const PlatformMouseEvent& event) override
{
switch (event.type()) {
case PlatformMouseEvent::Type::MousePressed: {
if (!m_client.mouseDown)
return false;
return m_client.mouseDown(toAPI(&pageOverlay), toAPI(event.position()), toAPI(event.button()), m_client.base.clientInfo);
}
case PlatformMouseEvent::Type::MouseReleased: {
if (!m_client.mouseUp)
return false;
return m_client.mouseUp(toAPI(&pageOverlay), toAPI(event.position()), toAPI(event.button()), m_client.base.clientInfo);
}
case PlatformMouseEvent::Type::MouseMoved: {
if (event.button() == MouseButton::NoButton) {
if (!m_client.mouseMoved)
return false;
return m_client.mouseMoved(toAPI(&pageOverlay), toAPI(event.position()), m_client.base.clientInfo);
}
// This is a MouseMove event with a mouse button pressed. Call mouseDragged.
if (!m_client.mouseDragged)
return false;
return m_client.mouseDragged(toAPI(&pageOverlay), toAPI(event.position()), toAPI(event.button()), m_client.base.clientInfo);
}
default:
return false;
}
}
示例6: mouseEvent
bool FindController::mouseEvent(PageOverlay&, const PlatformMouseEvent& mouseEvent)
{
if (mouseEvent.type() == PlatformEvent::MousePressed)
hideFindUI();
return false;
}
示例7: create
PassRefPtr<MouseEvent> MouseEvent::create(const AtomicString& eventType, PassRefPtr<AbstractView> view, const PlatformMouseEvent& event, int detail, PassRefPtr<Node> relatedTarget)
{
ASSERT(event.type() == PlatformEvent::MouseMoved || event.button() != NoButton);
bool isMouseEnterOrLeave = eventType == EventTypeNames::mouseenter || eventType == EventTypeNames::mouseleave;
bool isCancelable = !isMouseEnterOrLeave;
bool isBubbling = !isMouseEnterOrLeave;
return MouseEvent::create(eventType, isBubbling, isCancelable, view,
detail, event.globalPosition().x(), event.globalPosition().y(), event.position().x(), event.position().y(),
event.movementDelta().x(), event.movementDelta().y(),
event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), event.button(),
relatedTarget, nullptr, false);
}
示例8: create
PassRefPtr<MouseEvent> MouseEvent::create(const AtomicString& eventType, PassRefPtr<AbstractView> view, const PlatformMouseEvent& event, int detail, PassRefPtr<Node> relatedTarget)
{
ASSERT(event.type() == PlatformEvent::MouseMoved || event.button() != NoButton);
bool isCancelable = eventType != eventNames().mousemoveEvent;
return MouseEvent::create(eventType, true, isCancelable, view,
detail, event.globalPosition().x(), event.globalPosition().y(), event.position().x(), event.position().y(),
#if ENABLE(POINTER_LOCK)
event.movementDelta().x(), event.movementDelta().y(),
#endif
event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), event.button(),
relatedTarget, 0, false);
}
示例9: create
PassRefPtrWillBeRawPtr<MouseEvent> MouseEvent::create(const AtomicString& eventType, PassRefPtrWillBeRawPtr<AbstractView> view, const PlatformMouseEvent& event, int detail, PassRefPtrWillBeRawPtr<Node> relatedTarget)
{
ASSERT(event.type() == PlatformEvent::MouseMoved || event.button() != NoButton);
bool isMouseEnterOrLeave = eventType == EventTypeNames::mouseenter || eventType == EventTypeNames::mouseleave;
bool isCancelable = !isMouseEnterOrLeave;
bool isBubbling = !isMouseEnterOrLeave;
return MouseEvent::create(
eventType, isBubbling, isCancelable, view,
detail, event.globalPosition().x(), event.globalPosition().y(), event.position().x(), event.position().y(),
event.movementDelta().x(), event.movementDelta().y(),
event.modifiers(), event.button(),
platformModifiersToButtons(event.modifiers()),
relatedTarget, event.timestamp(), event.syntheticEventType());
}