Exemplo n.º 1
0
void FcitxQtKeySequenceWidgetPrivate::doneRecording(bool validate)
{
    modifierlessTimeout.stop();
    isRecording = false;
    keyButton->releaseKeyboard();
    keyButton->setDown(false);

    if (keySequence==oldKeySequence) {
        // The sequence hasn't changed
        updateShortcutDisplay();
        return;
    }

    Q_EMIT q->keySequenceChanged(keySequence, side);

    updateShortcutDisplay();
}
Exemplo n.º 2
0
void KeySequenceWidget::doneRecording()
{
    bool wasRecording = _isRecording;
    _isRecording = false;
    _keyButton->releaseKeyboard();
    _keyButton->setDown(false);

    if (!wasRecording || _keySequence == _oldKeySequence) {
        // The sequence hasn't changed
        updateShortcutDisplay();
        return;
    }

    if (!isKeySequenceAvailable(_keySequence)) {
        _keySequence = _oldKeySequence;
    }
    else if (wasRecording) {
        emit keySequenceChanged(_keySequence, _conflictingIndex);
    }
    updateShortcutDisplay();
}
Exemplo n.º 3
0
void KeySequenceWidget::startRecording()
{
    _modifierKeys = 0;
    _oldKeySequence = _keySequence;
    _keySequence = QKeySequence();
    _conflictingIndex = QModelIndex();
    _isRecording = true;
    _keyButton->grabKeyboard();

    if (!QWidget::keyboardGrabber()) {
        qWarning() << "Failed to grab the keyboard! Most likely qt's nograb option is active";
    }

    _keyButton->setDown(true);
    updateShortcutDisplay();
}
Exemplo n.º 4
0
void FcitxQtKeySequenceWidgetPrivate::startRecording()
{
    nKey = 0;
    modifierKeys = 0;
    oldKeySequence = keySequence;
    keySequence = QKeySequence();
    isRecording = true;
    keyButton->grabKeyboard();

    if (!QWidget::keyboardGrabber()) {
        qWarning() << "Failed to grab the keyboard! Most likely qt's nograb option is active";
    }

    keyButton->setDown(true);
    updateShortcutDisplay();
}