Skip to content

Display AltGr and Shift+AltGr characters#6

Open
b606 wants to merge 22 commits intobvbfan:masterfrom
b606:display-altgr-chars
Open

Display AltGr and Shift+AltGr characters#6
b606 wants to merge 22 commits intobvbfan:masterfrom
b606:display-altgr-chars

Conversation

@b606
Copy link
Copy Markdown

@b606 b606 commented Nov 13, 2025

Characters for Shift Level 3 (AltGr and Shift+AltGr) are displayed in the keys labels.
Still not real Qt 6 yet but if xvkbd is in most of linux repository, why not kvkbd :-)

  • Almost all of the dead keys are displayed in the button texts for keyboard layouts tested so far (fr, gr, de, us, ru variant, IPA) except a few, eg. two diacritics symbols are not displayed in "gr" layout when Shift+AltGr (keycodes 47 and 48.)

PS. This PR is based on my previous PR #4 which fixes the layouts and doc compilation problem that blocked make, and can be rebased on it. The relevant part starts at commit 663b8d8, introducing the changes listed below.

CHANGES

  • Class ButtonText changed to QList<QString> instead of QList<QChar>, with four components : normal, shift, alt-gr and shift+alt-gr labels.

  • Added button action "shiftLevel3Text" bound to Alt.Gr in src/themes/standard.xml

  • Use of functions in X11/XKBlib.h. The files "keysymconvert.{h,cpp}" are not needed in X11Keyboard class anymore but still left in the codebase.

  • Added member Display* X11Keyboard::m_display in order to reduce frequent calls to XOpenDisplay/XCloseDisplay. This fixes X error on older PC with a message : "Maximum number of clients reached."
    (XCloseDisplay does not catch up and one gets a display == nullptr).

b606 added 22 commits October 26, 2025 03:34
The call to DBus interface org.kde.KeyboardLayouts/getLayout
returns the layout_index.
The call to DBus interface org.kde.KeyboardLayouts/getLayoutsList
returns an array of structure (sss).
Ex. ([Argument: a(sss) {[Argument: (sss) "fr", "fr", "Français (variante)"]}]).
Works for up to four layouts (max on X11 ?)
(X maximum clients number reaches and Display == nullptr)
…resources.

* Moved Display* m_display as a member of X11Keyboard to avoid
  frequent calls to XOpenDisplay because groupTimer is connected to queryModState.

* Starting from commit 663b8d8, ("Get QChar level3 from keyCode", 2025-11-04),
  one gets error message from X after a few minutes:
    "Maximum number of clients reached." (display == nullptr).
  The command `lsof -U | grep kvkbd` shows that XCloseDisplay does not keep up.
mButtonText.at(index): index = 0:normal, 1:shift, 2:altgr, 3:altgr+shift
- Most of the dead keys are displayed in the button texts.
  Ex. Two keys with Alt.Gr not displayed in "gr" layout: keycodes 47, 48.

CHANGES
- Class ButtonText changed to  QList<QString> with four components :
  normal, shift, alt-gr, shift+alt-gr labels.

- Added button action "shiftLevel3Text" in src/themes/standard.xml

- Use of functions in <X11/XKBlib.h>. "keysymconvert.h" is not needed
  in X11Keyboard anymore.

- Added member Display* X11Keyboard::m_display in order to reduce frequent
  call to XOpenDisplay/XCloseDisplay. This fixes X error on older PC with
  a message : "Maximum number of clients reached."
  (XCloseDisplay does not catch up and one gets a display == nullptr).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant