예제 #1
0
void CompositorSettings::setKeyboardRepeatDelay(quint32 delay)
{
    Q_D(CompositorSettings);

    if (d->repeatDelay == delay)
        return;

    d->repeatDelay = delay;
    Q_EMIT keyboardRepeatDelayChanged();

    if (d->compositor) {
        QWaylandInputDevice *inputDevice = d->compositor->defaultInputDevice();
        if (inputDevice && inputDevice->keyboard())
            inputDevice->keyboard()->setRepeatDelay(d->repeatDelay);
    }
}
예제 #2
0
void CompositorSettings::setKeyboardRepeatRate(quint32 rate)
{
    Q_D(CompositorSettings);

    if (d->repeatRate == rate)
        return;

    d->repeatRate = rate;
    Q_EMIT keyboardRepeatRateChanged();

    if (d->compositor) {
        QWaylandInputDevice *inputDevice = d->compositor->defaultInputDevice();
        if (inputDevice && inputDevice->keyboard())
            inputDevice->keyboard()->setRepeatRate(d->repeatRate);
    }
}
예제 #3
0
void CompositorSettingsPrivate::_q_setupKeymap()
{
    if (!compositor || !keymap || !initialized)
        return;

    QWaylandInputDevice *inputDevice = compositor->defaultInputDevice();
    if (inputDevice && inputDevice->keyboard()) {
        qCDebug(gLcCore,
                "Setting keymap to '%s' (variant '%s', options '%s', model '%s', rules '%s')",
                qPrintable(keymap->layout()),
                qPrintable(keymap->variant()),
                qPrintable(keymap->options()),
                qPrintable(keymap->model()),
                qPrintable(keymap->rules()));

        QWaylandKeymap wlKeymap(keymap->layout(), keymap->variant(),
                                keymap->options(), keymap->model(),
                                keymap->rules());
        inputDevice->keyboard()->setKeymap(wlKeymap);

        inputDevice->keyboard()->setRepeatRate(repeatRate);
        inputDevice->keyboard()->setRepeatDelay(repeatDelay);
    }
}