void LH_CursorController::virtualKeyPress(QString s)
{
    qDebug() << "LH_CursorController: Virtual Key Press - " << s;
    if( s == "up" ) doMoveUp();
    else if( s == "down" ) doMoveDown();
    else if( s == "left" ) doMoveLeft();
    else if( s == "right" ) doMoveRight();
    else if( s == "sel" ) doSelect();
    else if( s == "act" ) doActivate();
    else if( s == "resel" ) doReselect();
}
Example #2
0
    bool Server::activate()
    {
        Mutex::Lock lock(_mutex);
        
        if(!_running)
        {
            _running = doActivate();
        }

        return _running;
    }
Example #3
0
// activate
//---------------------------------------------------------------------------
// Purpose: Default Implementation - Sets the window status to active.
//---------------------------------------------------------------------------
void View::activate()
{
    if (getActive()) {
        return;
    }

    // Set the active bit.
    status |= STATUS_ACTIVE;

    doActivate();

} // end View::activate
Example #4
0
bool Component::activate(vrkit::ViewerPtr viewer)
{
   try
   {
      doActivate(viewer);
      mActive = true;
   }
   catch (std::exception& ex)
   {
      std::cerr << "Failed to activate mode component '" << getDescription()
                << "':\n" << ex.what() << std::endl;
   }

   return mActive;
}
Example #5
0
void Q3TitleBar::mousePressEvent(QMouseEvent *e)
{
    Q_D(Q3TitleBar);
    if (!d->act)
        emit doActivate();
    if (e->button() == Qt::LeftButton) {
        d->pressed = true;
        QStyleOptionTitleBar opt = d->getStyleOption();
        QStyle::SubControl ctrl = style()->hitTestComplexControl(QStyle::CC_TitleBar, &opt,
                                                                 e->pos(), this);
        switch (ctrl) {
        case QStyle::SC_TitleBarSysMenu:
            if (d->flags & Qt::WindowSystemMenuHint) {
                d->buttonDown = QStyle::SC_None;
                static QTime *t = 0;
                static Q3TitleBar *tc = 0;
                if (!t)
                    t = new QTime;
                if (tc != this || t->elapsed() > QApplication::doubleClickInterval()) {
                    emit showOperationMenu();
                    t->start();
                    tc = this;
                } else {
                    tc = 0;
                    emit doClose();
                    return;
                }
            }
            break;

        case QStyle::SC_TitleBarShadeButton:
        case QStyle::SC_TitleBarUnshadeButton:
            if (d->flags & Qt::WindowShadeButtonHint)
                d->buttonDown = ctrl;
            break;

        case QStyle::SC_TitleBarNormalButton:
            if (d->flags & Qt::WindowMinMaxButtonsHint)
                d->buttonDown = ctrl;
            break;

        case QStyle::SC_TitleBarMinButton:
            if (d->flags & Qt::WindowMinimizeButtonHint)
                d->buttonDown = ctrl;
            break;

        case QStyle::SC_TitleBarMaxButton:
            if (d->flags & Qt::WindowMaximizeButtonHint)
                d->buttonDown = ctrl;
            break;

        case QStyle::SC_TitleBarCloseButton:
            if (d->flags & Qt::WindowSystemMenuHint)
                d->buttonDown = ctrl;
            break;

        case QStyle::SC_TitleBarLabel:
            d->buttonDown = ctrl;
            d->moveOffset = mapToParent(e->pos());
            break;

        default:
            break;
        }
        repaint();
    } else {
        d->pressed = false;
    }
}