diff --git a/kcms/access/accessibility.ui b/kcms/access/accessibility.ui --- a/kcms/access/accessibility.ui +++ b/kcms/access/accessibility.ui @@ -740,6 +740,194 @@ + + + Mouse Navigation + + + + + + + + &Move pointer with keyboard (using the num pad) + + + + + + + + 0 + 0 + + + + msec + + + 1 + + + 1000 + + + 50 + + + + + + + &Acceleration delay: + + + mk_delay + + + + + + + R&epeat interval: + + + mk_interval + + + + + + + + 0 + 0 + + + + msec + + + 1 + + + 1000 + + + 10 + + + + + + + Acceleration &time: + + + mk_time_to_max + + + + + + + + 0 + 0 + + + + msec + + + 100 + + + 10000 + + + 200 + + + + + + + Ma&ximum speed: + + + mk_max_speed + + + + + + + + 0 + 0 + + + + pixel/sec + + + 1 + + + 2000 + + + 20 + + + + + + + Acceleration &profile: + + + mk_curve + + + + + + + + 0 + 0 + + + + -1000 + + + 1000 + + + 100 + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + Screen Reader diff --git a/kcms/access/kcmaccess.cpp b/kcms/access/kcmaccess.cpp --- a/kcms/access/kcmaccess.cpp +++ b/kcms/access/kcmaccess.cpp @@ -237,6 +237,14 @@ connect(ui.kNotifyAccess, &QCheckBox::clicked, this, &KAccessConfig::checkAccess); connect(ui.kNotifyAccessButton, &QPushButton::clicked, this, &KAccessConfig::configureKNotify); + // keynboard navigation + connect(ui.mouseKeys, &QCheckBox::clicked, this, &KAccessConfig::configChanged); + connect(ui.mk_delay, static_cast(&QSpinBox::valueChanged), this, &KAccessConfig::configChanged); + connect(ui.mk_interval, static_cast(&QSpinBox::valueChanged), this, &KAccessConfig::configChanged); + connect(ui.mk_time_to_max, static_cast(&QSpinBox::valueChanged), this, &KAccessConfig::configChanged); + connect(ui.mk_max_speed, static_cast(&QSpinBox::valueChanged), this, &KAccessConfig::configChanged); + connect(ui.mk_curve, static_cast(&QSpinBox::valueChanged), this, &KAccessConfig::configChanged); + // screen reader connect(ui.screenReaderEnabled, &QCheckBox::clicked, this, &KAccessConfig::configChanged); connect(ui.launchOrcaConfiguration, &QPushButton::clicked, this, &KAccessConfig::launchOrcaConfiguration); @@ -336,6 +344,31 @@ ui.gestureConfirmation->setChecked(keyboardGroup.readEntry("GestureConfirmation", false)); ui.kNotifyAccess->setChecked(keyboardGroup.readEntry("kNotifyAccess", false)); + KConfigGroup mouseGroup(KSharedConfig::openConfig(QStringLiteral("kaccessrc")), "Mouse"); + ui.mouseKeys->setChecked(mouseGroup.readEntry("MouseKeys", false)); + ui.mk_delay->setValue(mouseGroup.readEntry("MKDelay", 160)); + + const int interval = mouseGroup.readEntry("MKInterval", 5); + ui.mk_interval->setValue(interval); + + // Default time to reach maximum speed: 5000 msec + int time_to_max = mouseGroup.readEntry("MKTimeToMax", (5000+interval/2)/interval); + time_to_max = mouseGroup.readEntry("MK-TimeToMax", time_to_max*interval); + ui.mk_time_to_max->setValue(time_to_max); + + // Default maximum speed: 1000 pixels/sec + // (The old default maximum speed from KDE <= 3.4 + // (100000 pixels/sec) was way too fast) + long max_speed = mouseGroup.readEntry("MKMaxSpeed", interval); + max_speed = max_speed * 1000 / interval; + if (max_speed > 2000) { + max_speed = 2000; + } + max_speed = mouseGroup.readEntry("MK-MaxSpeed", int(max_speed)); + ui.mk_max_speed->setValue(max_speed); + + ui.mk_curve->setValue(mouseGroup.readEntry("MKCurve", 0)); + KConfigGroup screenReaderGroup(KSharedConfig::openConfig(QStringLiteral("kaccessrc")), "ScreenReader"); ui.screenReaderEnabled->setChecked(screenReaderGroup.readEntry("Enabled", false)); @@ -391,6 +424,18 @@ keyboardGroup.sync(); + KConfigGroup mouseGroup(KSharedConfig::openConfig(QStringLiteral("kaccessrc")), "Mouse"); + const int interval = ui.mk_interval->value(); + mouseGroup.writeEntry("MouseKeys", ui.mouseKeys->isChecked()); + mouseGroup.writeEntry("MKDelay", ui.mk_delay->value()); + mouseGroup.writeEntry("MKInterval", interval); + mouseGroup.writeEntry("MK-TimeToMax", ui.mk_time_to_max->value()); + mouseGroup.writeEntry("MKTimeToMax", (ui.mk_time_to_max->value() + interval/2)/interval); + mouseGroup.writeEntry("MK-MaxSpeed", ui.mk_max_speed->value()); + mouseGroup.writeEntry("MKMaxSpeed", (ui.mk_max_speed->value()*interval + 500)/1000); + mouseGroup.writeEntry("MKCurve", ui.mk_curve->value()); + mouseGroup.sync(); + KConfigGroup screenReaderGroup(KSharedConfig::openConfig(QStringLiteral("kaccessrc")), "ScreenReader"); screenReaderGroup.writeEntry("Enabled", ui.screenReaderEnabled->isChecked()); @@ -450,6 +495,13 @@ ui.gestureConfirmation->setChecked(true); ui.kNotifyAccess->setChecked(false); + ui.mouseKeys->setChecked(false); + ui.mk_delay->setValue(160); + ui.mk_interval->setValue(5); + ui.mk_time_to_max->setValue(5000); + ui.mk_max_speed->setValue(1000); + ui.mk_curve->setValue(0); + ui.screenReaderEnabled->setChecked(false); checkAccess();