/*SPDX-FileCopyrightText: 2018 Tomaz Canabrava <tcanabrava@kde.org>SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL*/import QtQuickimport QtQuick.Layoutsimport QtQuick.Controls as QQC2import org.kde.kcmutils as KCMUtilsimport org.kde.kirigami as Kirigamiimport org.kde.plasma.access.kcmKirigami.Form {Kirigami.FormGroup {Kirigami.FormEntry {title: i18nc("@title:group prefix", "Slow keys:")contentItem: QQC2.CheckBox {id: slowKeystext: i18nc("@option:check Enable slow keys", "Enable")KCMUtils.SettingStateBinding {configObject: kcm.keyboardFiltersSettingssettingName: "SlowKeys"}checked: kcm.keyboardFiltersSettings.slowKeysonToggled: kcm.keyboardFiltersSettings.slowKeys = checked}trailingItems: [Kirigami.ContextualHelpButton {toolTipText: i18nc("@info:tooltip", "For a key to be accepted, it has to be held until the set amount of time. Useful if you accidentally type more than one key at a time or have difficulty pressing the key you want the first time.")}]}Kirigami.FormEntry {title: i18nc("@label:spinbox Slow keys Delay", "Delay:")contentItem: QQC2.SpinBox {id: slowKeyDelayKCMUtils.SettingStateBinding {configObject: kcm.keyboardFiltersSettingssettingName: "SlowKeysDelay"extraEnabledConditions: kcm.keyboardFiltersSettings.slowKeys}from: 100to: 10000value: kcm.keyboardFiltersSettings.slowKeysDelayonValueModified: kcm.keyboardFiltersSettings.slowKeysDelay = valuetextFromValue: function(value, locale) {return i18ncp("@label:valuesuffix %1 is slow keys delay", "%1 ms", "%1 ms", value)}validator: IntValidatorWithSuffix {bottom: slowKeyDelay.fromtop: slowKeyDelay.to}valueFromText: (text, locale) => {return Number.fromLocaleString(locale, text.replace(i18ncp("@label:valuesuffix short for millisecond(s)", "ms", "ms"), ""))}}}Kirigami.FormSeparator {}Kirigami.FormEntry {title: i18nc("@title:group prefix for checkbox group", "Ring system bell:")contentItem: QQC2.CheckBox {id: slowKeysPressBeeptext: i18nc("@option:check Use system bell when a key is pressed", "when any key is &pressed")KCMUtils.SettingStateBinding {configObject: kcm.keyboardFiltersSettingssettingName: "SlowKeysPressBeep"extraEnabledConditions: kcm.keyboardFiltersSettings.slowKeys}checked: kcm.keyboardFiltersSettings.slowKeysPressBeeponToggled: kcm.keyboardFiltersSettings.slowKeysPressBeep = checked}}Kirigami.FormEntry {contentItem: QQC2.CheckBox {id: slowKeysAcceptBeeptext: i18nc("@option:check Use system bell when a key is accepted", "when any key is &accepted")KCMUtils.SettingStateBinding {configObject: kcm.keyboardFiltersSettingssettingName: "SlowKeysAcceptBeep"extraEnabledConditions: kcm.keyboardFiltersSettings.slowKeys}checked: kcm.keyboardFiltersSettings.slowKeysAcceptBeeponToggled: kcm.keyboardFiltersSettings.slowKeysAcceptBeep = checked}}Kirigami.FormEntry {contentItem: QQC2.CheckBox {id: slowKeysRejectBeeptext: i18nc("@option:check Use system bell when a key is rejected", "when any key is &rejected")KCMUtils.SettingStateBinding {configObject: kcm.keyboardFiltersSettingssettingName: "SlowKeysRejectBeep"extraEnabledConditions: kcm.keyboardFiltersSettings.slowKeys}checked: kcm.keyboardFiltersSettings.slowKeysRejectBeeponToggled: kcm.keyboardFiltersSettings.slowKeysRejectBeep = checked}}}Kirigami.FormGroup {Kirigami.FormEntry {title: i18nc("@title:group prefix", "Bounce keys:")contentItem: QQC2.CheckBox {id: bounceKeystext: i18nc("@option:check Bounce keys enable", "Enable");KCMUtils.SettingStateBinding {configObject: kcm.keyboardFiltersSettingssettingName: "BounceKeys"}checked: kcm.keyboardFiltersSettings.bounceKeysonToggled: kcm.keyboardFiltersSettings.bounceKeys = checked}trailingItems: [Kirigami.ContextualHelpButton {toolTipText: i18nc("@info:tooltip", "Ignore rapid, repeated keypresses of the same key. Useful if you have hand tremors that cause you to press a key multiple times when you only intend to press once.")}]}Kirigami.FormEntry {title: i18nc("@label:spinbox Bounce keys delay", "Delay:")contentItem: QQC2.SpinBox {id: bounceKeysDelayKCMUtils.SettingStateBinding {configObject: kcm.keyboardFiltersSettingssettingName: "BounceKeysDelay"extraEnabledConditions: kcm.keyboardFiltersSettings.bounceKeys}from: 5to: 10000value: kcm.keyboardFiltersSettings.bounceKeysDelayonValueModified: kcm.keyboardFiltersSettings.bounceKeysDelay = valuetextFromValue: function(value, locale) {return i18ncp("@label:valuesuffix %1 is bounce keys delay", "%1 ms", "%1 ms", value)}validator: IntValidatorWithSuffix {bottom: bounceKeysDelay.fromtop: bounceKeysDelay.to}valueFromText: (text, locale) => {return Number.fromLocaleString(locale, text.replace(i18ncp("@label:valuesuffix short for millisecond(s)", "ms", "ms"), ""))}}}Kirigami.FormEntry {contentItem: QQC2.CheckBox {id: bounceKeysRejectBeeptext: i18nc("@option:check for bounce keys", "Ring system bell when rejected")KCMUtils.SettingStateBinding {configObject: kcm.keyboardFiltersSettingssettingName: "BounceKeysRejectBeep"extraEnabledConditions: kcm.keyboardFiltersSettings.bounceKeys}checked: kcm.keyboardFiltersSettings.bounceKeysRejectBeeponToggled: kcm.keyboardFiltersSettings.bounceKeysRejectBeep = checked}}}}