From a67db2d4847d798c01d4fd7584c5bb9297e109e3 Mon Sep 17 00:00:00 2001 From: Mavridis Philippe Date: Fri, 6 Jan 2023 15:30:57 +0200 Subject: Kxkb: Improve layout switching 1) New layout switching approach The new approach is based on the "grp" options group of Xkb and so enables us to use predefined X11 layout (group) switching hotkeys like "Caps Lock" or "Shift+Alt" (you can see the full list in the Options tab). The added bonus to this is that we conform to the Xkb setting. The code lets Xkb handle the keyboard layout switching hotkey(s) and is similar to the one that is used in kkbswitch, monitoring for an Xkb group (layout) change event. This solution required me to remove some hacky and obsolete code which was there to support really old pre-XFree-4.2 era systems and included the "include groups" hack. This means that the "Enable latin layout" checkbox is now gone and setxkbmap is only called when the keyboard layouts and/or options are modified, and not for every layout change. 2) Common layout switching hotkeys combobox A combobox was added to the first page of the Keyboard Layouts KCM module. It provides to the users a quick way to set a layout switching key combination. It also controls the "grp" group in the Xkb tab. A special note about this combobox is that, even if Append Mode was selected in the Xkb Options tab, this hotkey will overwrite previous hotkey options. This means that all grp: options will be forced removed before applying the option from the combobox (in contrast to specifying options via the Xkb Options tab, which, in Append Mode, will not get overwritten until next login). Signed-off-by: Mavridis Philippe --- kxkb/kcmlayout.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'kxkb/kcmlayout.h') diff --git a/kxkb/kcmlayout.h b/kxkb/kcmlayout.h index 987fff2b0..e16c09bf7 100644 --- a/kxkb/kcmlayout.h +++ b/kxkb/kcmlayout.h @@ -27,7 +27,7 @@ public: void defaults(); void initUI(); virtual TQString handbookDocPath() const; - + protected: TQString createOptionString(); void updateIndicator(TQListViewItem* selLayout); @@ -35,13 +35,14 @@ protected: protected slots: void moveUp(); void moveDown(); + void hotkeyComboChanged(); void variantChanged(); void displayNameChanged(const TQString& name); - void latinChanged(); void layoutSelChanged(TQListViewItem *); void loadRules(); void updateLayoutCommand(); void updateOptionsCommand(); + void updateHotkeyCombo(); void add(); void remove(); -- cgit v1.2.1