Warning, /plasma/plasma-desktop/kcms/access/ui/ModifierKeys.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2018 Tomaz Canabrava <tcanabrava@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006 
0007 import QtQuick 2.6
0008 import QtQuick.Layouts 1.1
0009 import QtQuick.Controls 2.12 as QQC2
0010 import org.kde.kcmutils as KCM
0011 
0012 import org.kde.kirigami 2.3 as Kirigami
0013 
0014 Kirigami.FormLayout {
0015     QQC2.CheckBox {
0016         Kirigami.FormData.label: i18n("Sticky keys:")
0017         text: i18nc("Enable sticky keys", "Enable")
0018 
0019         KCM.SettingStateBinding {
0020             configObject: kcm.keyboardSettings
0021             settingName: "StickyKeys"
0022         }
0023 
0024         checked: kcm.keyboardSettings.stickyKeys
0025         onToggled: kcm.keyboardSettings.stickyKeys = checked
0026     }
0027     QQC2.CheckBox {
0028         text: i18nc("Lock sticky keys", "Lock")
0029 
0030         KCM.SettingStateBinding {
0031             configObject: kcm.keyboardSettings
0032             settingName: "StickyKeysLatch"
0033             extraEnabledConditions: kcm.keyboardSettings.stickyKeys
0034         }
0035 
0036         checked: kcm.keyboardSettings.stickyKeysLatch
0037         onToggled: kcm.keyboardSettings.stickyKeysLatch = checked
0038     }
0039     QQC2.CheckBox {
0040         id: stickyKeysAutoOff
0041 
0042         text: i18n("Disable when two keys are held down")
0043 
0044         KCM.SettingStateBinding {
0045             configObject: kcm.keyboardSettings
0046             settingName: "StickyKeysAutoOff"
0047             extraEnabledConditions: kcm.keyboardSettings.stickyKeys
0048         }
0049 
0050         checked: kcm.keyboardSettings.stickyKeysAutoOff
0051         onToggled: kcm.keyboardSettings.stickyKeysAutoOff = checked
0052     }
0053     QQC2.CheckBox {
0054         text: i18n("Ring system bell when modifier keys are used")
0055 
0056         KCM.SettingStateBinding {
0057             configObject: kcm.keyboardSettings
0058             settingName: "StickyKeysBeep"
0059             extraEnabledConditions: kcm.keyboardSettings.stickyKeys
0060         }
0061 
0062         checked: kcm.keyboardSettings.stickyKeysBeep
0063         onToggled: kcm.keyboardSettings.stickyKeysBeep = checked
0064     }
0065 
0066     Item {
0067         Kirigami.FormData.isSection: true
0068     }
0069 
0070     QQC2.CheckBox {
0071         Kirigami.FormData.label: i18n("Feedback:")
0072         text: i18n("Ring system bell when locking keys are toggled")
0073 
0074         KCM.SettingStateBinding {
0075             configObject: kcm.keyboardSettings
0076             settingName: "ToggleKeysBeep"
0077         }
0078 
0079         checked: kcm.keyboardSettings.toggleKeysBeep
0080         onToggled: kcm.keyboardSettings.toggleKeysBeep = checked
0081     }
0082     QQC2.CheckBox {
0083         text: i18n("Show notification when modifier or locking keys are used")
0084 
0085         KCM.SettingStateBinding {
0086             configObject: kcm.keyboardSettings
0087             settingName: "KeyboardNotifyModifiers"
0088         }
0089 
0090         checked: kcm.keyboardSettings.keyboardNotifyModifiers
0091         onToggled: kcm.keyboardSettings.keyboardNotifyModifiers = checked
0092     }
0093     QQC2.Button {
0094         id: this
0095         text: i18n("Configure Notifications…")
0096         icon.name: "preferences-desktop-notification"
0097 
0098         onClicked: kcm.configureKNotify()
0099     }
0100 }