The old non-QML lockscreen had accelerator keys for the buttons of the lockscreen ("Switch User", "Unlock", etc.). The new QML based lockscreen is missing accelerators in all dialogs. Please re-add the accelerators before 4.10 final. Unfortunately I couldn't find any documentation regarding accelerators in QML, even in QML dialogs which render accelerators (e.g. Shutdown dialog) I couldn't find any reference to accelerators in the code.
AFAIK accelerator keys are not yet supported in QML in general.
Created attachment 75454 [details] Screenshot showing accelerator keys on the logout dialog. Isn't the shutdown dialog also QML? There I have accelerator keys (see attached screenshot) and they are working.
(In reply to comment #2) > Created attachment 75454 [details] > Screenshot showing accelerator keys on the logout dialog. > > Isn't the shutdown dialog also QML? There I have accelerator keys (see > attached screenshot) and they are working. Hmm, now that I looked into the code again, it looks like it is that simple: /usr/share/apps/ksmserver/themes/default/main.qml:310: text: i18n("&Restart Computer")
Hmm, and doing this: text: i18n("&Unlock") in /usr/share/apps/ksmserver/screenlocker/org.kde.passworddialog/contents/ui/Greeter.qml:125 just results in & being rendered onto the button instead of having it evaluated as accelerator. Something must be missing…
The logout dialog uses a "KSMButton{}" whereas the greeter of the passworddialog uses a plain "PlasmaComponents.Button{}". Couldn't find out yet, where KSMButton is defined, but I assume it's a special button derived from PlasmaComponents.Button which handles the accelerators. Digging deeper now… ;)
Ok, found this snippet in /usr/share/apps/ksmserver/themes/default/main.qml: // implement label accelerators in the buttons (the '&' in button's text). var buttons = [ logoutButton, shutdownButton, rebootButton, cancelButton ] for (var b = 0; b < buttons.length; ++b ) { if (buttons[b].accelKey > -1) { Helper.buttonForAccel[String.fromCharCode(buttons[b].accelKey)] = buttons[b]; } } } // trigger action on Alt+'accelerator' key press. For example: if KSMButton.text == &Cancel, // pressing Alt+'C' or Alt+'c' will trigger KSMButton.clicked(). Keys.onPressed: { if ((event.modifiers & Qt.AltModifier) && Helper.buttonForAccel[String.fromCharCode(event.key)] != undefined) { Helper.buttonForAccel[String.fromCharCode(event.key)].clicked() } }
Git commit ca18bf25ff49bfe128078b5fee1d861b6538ebaf by Aaron Seigo. Committed on 11/01/2013 at 15:43. Pushed by aseigo into branch 'master'. hack in keyboard accel for buttons horribly ugly in implementation, but until QML gets proper key accel handling this is probably what we stuck with for now A +24 -0 ksmserver/screenlocker/greeter/themes/org.kde.passworddialog/contents/ui/AccelButton.qml [License: UNKNOWN] * M +35 -11 ksmserver/screenlocker/greeter/themes/org.kde.passworddialog/contents/ui/Greeter.qml M +27 -6 ksmserver/screenlocker/greeter/themes/org.kde.passworddialog/contents/ui/SessionSwitching.qml M +9 -4 ksmserver/screenlocker/greeter/themes/org.kde.passworddialog/contents/ui/main.qml The files marked with a * at the end have a non valid license. Please read: http://techbase.kde.org/Policies/Licensing_Policy and use the headers which are listed at that page. http://commits.kde.org/kde-workspace/ca18bf25ff49bfe128078b5fee1d861b6538ebaf