void EventSenderProxy::mouseDown(unsigned button, WKEventModifiers wkModifiers)
{
    // If the same mouse button is already in the down position don't
    // send another event as it may confuse Xvfb.
    unsigned gdkButton = eventSenderButtonToGDKButton(button);
    if (m_mouseButtonCurrentlyDown == gdkButton)
        return;

    m_mouseButtonCurrentlyDown = gdkButton;

    // Normally GDK will send both GDK_BUTTON_PRESS and GDK_2BUTTON_PRESS for
    // the second button press during double-clicks. WebKit GTK+ selectively
    // ignores the first GDK_BUTTON_PRESS of that pair using gdk_event_peek.
    // Since our events aren't ever going onto the GDK event queue, WebKit won't
    // be able to filter out the first GDK_BUTTON_PRESS, so we just don't send
    // it here. Eventually this code should probably figure out a way to get all
    // appropriate events onto the event queue and this work-around should be
    // removed.
    updateClickCountForButton(button);

    GdkEventType eventType;
    if (m_clickCount == 2)
        eventType = GDK_2BUTTON_PRESS;
    else if (m_clickCount == 3)
        eventType = GDK_3BUTTON_PRESS;
    else
        eventType = GDK_BUTTON_PRESS;

    GdkEvent* event = createMouseButtonEvent(eventType, button, wkModifiers);
    sendOrQueueEvent(event);
}
void EventSenderProxy::mouseDown(unsigned button, WKEventModifiers wkModifiers)
{
    if (m_mouseButton == button)
        return;

    m_mouseButton = button;
    updateClickCountForButton(button);

    sendOrQueueEvent(WTREvent(WTREventTypeMouseDown, 0, wkModifiers, evasMouseButton(button)));
}
Beispiel #3
0
void EventSenderProxy::mouseDown(unsigned button, WKEventModifiers wkModifiers)
{
    Qt::KeyboardModifiers modifiers = getModifiers(wkModifiers);
    Qt::MouseButton mouseButton = getMouseButton(button);

    updateClickCountForButton(button);

    m_mouseButtons |= mouseButton;

    QPoint mousePos(m_position.x, m_position.y);
    QMouseEvent* event = new QMouseEvent((m_clickCount == 2) ? QEvent::MouseButtonDblClick : QEvent::MouseButtonPress,
        mousePos, mousePos, mouseButton, m_mouseButtons, modifiers);

    sendOrQueueEvent(event);
}