コード例 #1
0
ファイル: EventReceiver.cpp プロジェクト: weetgo/Deflect
void EventReceiver::_onEvent(const int socket)
{
    if (socket != _stream.getDescriptor())
        return;

    while (_stream.hasEvent())
    {
        const Event& deflectEvent = _stream.getEvent();

        switch (deflectEvent.type)
        {
        case Event::EVT_CLOSE:
            _stop();
            return;
        case Event::EVT_PRESS:
            emit pressed(_pos(deflectEvent));
            break;
        case Event::EVT_RELEASE:
            emit released(_pos(deflectEvent));
            break;
        case Event::EVT_MOVE:
            emit moved(_pos(deflectEvent));
            break;
        case Event::EVT_VIEW_SIZE_CHANGED:
            emit resized(QSize{int(deflectEvent.dx), int(deflectEvent.dy)});
            break;
        case Event::EVT_SWIPE_LEFT:
            emit swipeLeft();
            break;
        case Event::EVT_SWIPE_RIGHT:
            emit swipeRight();
            break;
        case Event::EVT_SWIPE_UP:
            emit swipeUp();
            break;
        case Event::EVT_SWIPE_DOWN:
            emit swipeDown();
            break;
        case Event::EVT_KEY_PRESS:
            emit keyPress(deflectEvent.key, deflectEvent.modifiers,
                          QString::fromStdString(deflectEvent.text));
            break;
        case Event::EVT_KEY_RELEASE:
            emit keyRelease(deflectEvent.key, deflectEvent.modifiers,
                            QString::fromStdString(deflectEvent.text));
            break;
        case Event::EVT_TOUCH_ADD:
            emit touchPointAdded(deflectEvent.key, _pos(deflectEvent));
            break;
        case Event::EVT_TOUCH_UPDATE:
            emit touchPointUpdated(deflectEvent.key, _pos(deflectEvent));
            break;
        case Event::EVT_TOUCH_REMOVE:
            emit touchPointRemoved(deflectEvent.key, _pos(deflectEvent));
            break;
        case Event::EVT_CLICK:
        case Event::EVT_DOUBLECLICK:
        case Event::EVT_PINCH:
        case Event::EVT_WHEEL:
        default:
            break;
        }
    }

    if (!_stream.isConnected())
        _stop();
}
コード例 #2
0
void QQnxNavigatorEventHandler::handleSwipeDown()
{
    qNavigatorEventHandlerDebug() << Q_FUNC_INFO;

    Q_EMIT swipeDown();
}
コード例 #3
0
ファイル: aircursor.cpp プロジェクト: madamiky/Qt_AirCursor
void XN_CALLBACK_TYPE AirCursor::swipeDownCB(XnFloat fVelocity, XnFloat fAngle, void* cxt)
{
    //std::cout << "Swipe DOWN velocity: " << fVelocity << " angle: " << fAngle << std::endl;
    AirCursor* ac = (AirCursor*)cxt;
    ac->emit swipeDown(fVelocity, fAngle);
}