예제 #1
0
파일: EventQueue.cpp 프로젝트: carlsonp/osg
GUIEventAdapter*  EventQueue::touchMoved(unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y, double time)
{
    _accumulateEventState->setX(x);
    _accumulateEventState->setY(y);

    
    GUIEventAdapter* event = new GUIEventAdapter(*_accumulateEventState);
    event->setEventType(GUIEventAdapter::DRAG);
    event->setTime(time);
    event->addTouchPoint(id, phase, x, y, 0);
    addEvent(event);
    
    return event;
}
예제 #2
0
파일: EventQueue.cpp 프로젝트: carlsonp/osg
GUIEventAdapter*  EventQueue::touchEnded(unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y, unsigned int tap_count, double time)
{
    _accumulateEventState->setButtonMask(~(1) & _accumulateEventState->getButtonMask());
    _accumulateEventState->setX(x);
    _accumulateEventState->setY(y);
    
    GUIEventAdapter* event = new GUIEventAdapter(*_accumulateEventState);
    event->setEventType(GUIEventAdapter::RELEASE);
    event->setTime(time);
    event->addTouchPoint(id, phase, x, y, tap_count);
    addEvent(event);
    
    return event;
}
예제 #3
0
파일: EventQueue.cpp 프로젝트: carlsonp/osg
GUIEventAdapter*  EventQueue::touchBegan(unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y, double time)
{
    // emulate left mouse button press
    
    _accumulateEventState->setButtonMask((1) | _accumulateEventState->getButtonMask());
    _accumulateEventState->setX(x);
    _accumulateEventState->setY(y);
    
    GUIEventAdapter* event = new GUIEventAdapter(*_accumulateEventState);
    event->setEventType(GUIEventAdapter::PUSH);
    event->setTime(time);
    event->addTouchPoint(id, phase, x, y, 0);
  
    addEvent(event);
    
    return event;
}
예제 #4
0
GUIEventAdapter* EventQueue::touchEnded(unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y, unsigned int tap_count, double time)
{
    if (_firstTouchEmulatesMouse)
    {
        _accumulateEventState->setButtonMask(~GUIEventAdapter::LEFT_MOUSE_BUTTON & _accumulateEventState->getButtonMask());
        _accumulateEventState->setX(x);
        _accumulateEventState->setY(y);
    }

    GUIEventAdapter* event = new GUIEventAdapter(*_accumulateEventState);
    event->setEventType(GUIEventAdapter::RELEASE);
    event->setTime(time);
    event->addTouchPoint(id, phase, x, y, tap_count);
    if(_firstTouchEmulatesMouse)
        event->setButton(GUIEventAdapter::LEFT_MOUSE_BUTTON);

    addEvent(event);

    return event;
}