graesslin created this revision. graesslin added reviewers: KWin, Plasma on Wayland. Restricted Application added subscribers: kwin, plasma-devel. Restricted Application added projects: Plasma on Wayland, KWin.
REVISION SUMMARY Our keyboard layout kcm allows to set a global shortcut to switch to a specific keyboard layout. So far KWin/Wayland did not support those shortcuts, only the switch to next layout shortcut was supported. This change introduces support for custom layout shortcuts. For that we iterate over all available layouts and check whether a shortcut is registered. If that is the case a QAction is created and passed to KGlobalAccel. As the triggering code is similar to the menu, the switchLayout lambda is split out into a dedicated method and translating the layouts is extracted into a method. BRANCH keyboard-layout-per-layout-shortcut REVISION DETAIL https://phabricator.kde.org/D4256 AFFECTED FILES keyboard_layout.cpp keyboard_layout.h EMAIL PREFERENCES https://phabricator.kde.org/settings/panel/emailpreferences/ To: graesslin, #kwin, #plasma_on_wayland Cc: plasma-devel, kwin, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, eliasp, sebas