Ejemplo n.º 1
0
bool VncView::event(QEvent *event)
{
    QMouseEvent *ev = static_cast<QMouseEvent*>(event);
    QKeyEvent *ek = static_cast<QKeyEvent*>(event);
    QWheelEvent *ew = static_cast<QWheelEvent*>(event);
    switch (event->type()) {
    case QEvent::KeyPress:
    case QEvent::KeyRelease:
//         kDebug(5011) << "keyEvent";
        if ( ek!=Q_NULLPTR ) keyEventHandler(ek);
        return true;
    case QEvent::MouseButtonDblClick:
    case QEvent::MouseButtonPress:
    case QEvent::MouseButtonRelease:
        emit mouseClickedInto();
        if ( ev!=Q_NULLPTR ) mouseEventHandler(ev);
        return true;
    case QEvent::MouseMove:
//         kDebug(5011) << "mouseEvent";
        if ( 0<=ev->y() && ev->y()<= 3 )
            emit boarderTouched();
        mouseEventHandler(ev);
        return true;
    case QEvent::Wheel:
//         kDebug(5011) << "wheelEvent";
        if ( ew!=Q_NULLPTR ) wheelEventHandler(ew);
        return true;
    default:
        return RemoteView::event(event);
    }
}
Ejemplo n.º 2
0
bool VncView::event(QEvent *event)
{
    switch (event->type()) {
    case QEvent::KeyPress:
    case QEvent::KeyRelease:
//         kDebug(5011) << "keyEvent";
        keyEventHandler(static_cast<QKeyEvent*>(event));
        return true;
        break;
    case QEvent::MouseButtonDblClick:
    case QEvent::MouseButtonPress:
    case QEvent::MouseButtonRelease:
    case QEvent::MouseMove:
//         kDebug(5011) << "mouseEvent";
        mouseEventHandler(static_cast<QMouseEvent*>(event));
        return true;
        break;
    case QEvent::Wheel:
//         kDebug(5011) << "wheelEvent";
        wheelEventHandler(static_cast<QWheelEvent*>(event));
        return true;
        break;
    default:
        return RemoteView::event(event);
    }
}