#11 After pressing AltGr, the corresponding characters are not displayed on the buttons

Closed
opened 3 weeks ago by SlavekB · 3 comments
SlavekB commented 3 weeks ago
Owner

Basic information

  • TDE version: R14.0.10 [DEVELOPMENT]
  • APP version: 0.4.8
  • Distribution: Jessie/Stretch
  • System: Linux 4.9.0-14-amd64
  • Hardware: x86_64
  • Compiler: GNU 4.9.2

Description

On the Czech keyboard (and probably others), AltGr functions as a modifier, similar to Shift. For example, AltGr+Q writes \, AltGr+W writes |, AltGr+X writes #, AltGr+C writes &,… Kvkbd including all current patches writes the expected characters, but after pressing AltGr on the virtual keyboard is not rendered corresponding characters on the buttons.

Steps to reproduce

  1. Add the Czech keyboard layout and select it as active.
  2. Press on kvkbd right Alt (AltrGr).
  3. Observe that the characters on the buttons remained unchanged.
  4. Press X – you will see that it will be written #.
<!-- This is a comment. Please fill in the required fields below. The comments provide instructions on how to do so. Note: You do not need to remove comments. --> ## Basic information - TDE version: R14.0.10 [DEVELOPMENT] - APP version: 0.4.8 - Distribution: Jessie/Stretch - System: Linux 4.9.0-14-amd64 - Hardware: x86_64 - Compiler: GNU 4.9.2 <!-- Use SL/* labels to set the severity level. Please do not set a milestone. --> ## Description On the Czech keyboard (and probably others), AltGr functions as a modifier, similar to Shift. For example, AltGr+Q writes `\`, AltGr+W writes `|`, AltGr+X writes `#`, AltGr+C writes `&`,… Kvkbd including all current patches writes the expected characters, but after pressing AltGr on the virtual keyboard is not rendered corresponding characters on the buttons. ## Steps to reproduce 1. Add the Czech keyboard layout and select it as active. 2. Press on kvkbd right Alt (AltrGr). 3. Observe that the characters on the buttons remained unchanged. 4. Press X – you will see that it will be written `#`.
Ray-V commented 3 weeks ago
Collaborator

Displaying AltGr characters would be a nice-to-have feature but that result is consistent with the current source code.
kvkbd doesn't generate the print characters but takes the X11 data generated from the keypress to display the character on the key.

AltGr characters are 3rd level characters and are defined in the keyboard symbols files, eg Czech keyboard, probably at /usr/share/X11/xkb/symbols/cz

key <AB02>  { [         x,          X,   numbersign,     Nosymbol ] };

Here, 'X' is the shift character - it just happens to be the same as upper case 'x'.
And AltGr+Shift+x prints '>' because the latin map takes precedence where no symbol is defined.

At the moment, only 1st and 2nd level characters are generated for display on the keys.
In MainWidget::setupText(VButton& v):

	KeySym keysym_l = XkbKeycodeToKeysym(display, keycode, 0, 0);

provides the 1st level, lower, character, and

	KeySym keysym_u = XkbKeycodeToKeysym(display, keycode, 0, 1);

provides the 2nd level, shift, character, with each of those capitalized with upper(),
and it will need something like

	KeySym keysym_a = XkbKeycodeToKeysym(display, keycode, 0, 2);

added to be able to display the 3rd level, AltGr, characters.

And

	KeySym keysym_b = XkbKeycodeToKeysym(display, keycode, 0, 3);

if you want the 4th level, AltGr+Shift, characters displayed as well, for example ß:

key <AC11>  { [   section,     exclam,   apostrophe,       ssharp ] };
                  §            !         '                 ß

I'll be happy to help in any way I can to implement those changes, but it's unlikely I'd be able to make much of a contribution to the programming effort.

Displaying AltGr characters would be a nice-to-have feature but that result is consistent with the current source code. kvkbd doesn't generate the print characters but takes the X11 data generated from the keypress to display the character on the key. AltGr characters are 3rd level characters and are defined in the keyboard symbols files, eg Czech keyboard, probably at /usr/share/X11/xkb/symbols/cz ``` key <AB02> { [ x, X, numbersign, Nosymbol ] }; ``` Here, 'X' is the shift character - it just happens to be the same as upper case 'x'. And AltGr+Shift+x prints '>' because the latin map takes precedence where no symbol is defined. At the moment, only 1st and 2nd level characters are generated for display on the keys. In MainWidget::setupText(VButton& v): ``` KeySym keysym_l = XkbKeycodeToKeysym(display, keycode, 0, 0); ``` provides the 1st level, lower, character, and ``` KeySym keysym_u = XkbKeycodeToKeysym(display, keycode, 0, 1); ``` provides the 2nd level, shift, character, with each of those capitalized with upper(), and it will need something like ``` KeySym keysym_a = XkbKeycodeToKeysym(display, keycode, 0, 2); ``` added to be able to display the 3rd level, AltGr, characters. And ``` KeySym keysym_b = XkbKeycodeToKeysym(display, keycode, 0, 3); ``` if you want the 4th level, AltGr+Shift, characters displayed as well, for example ß: ``` key <AC11> { [ section, exclam, apostrophe, ssharp ] }; § ! ' ß ``` I'll be happy to help in any way I can to implement those changes, but it's unlikely I'd be able to make much of a contribution to the programming effort.
MicheleC commented 3 weeks ago
Owner

Hi @SlavekB, @Ray-V,
this was already on my TODO list after merging #10, in fact I had already started to code this, together with some code restructuring. I will create a PR for testing when finished and you can both help out testing it before we merge it to master.

Hi @SlavekB, @Ray-V, this was already on my TODO list after merging #10, in fact I had already started to code this, together with some code restructuring. I will create a PR for testing when finished and you can both help out testing it before we merge it to master.
MicheleC commented 2 weeks ago
Owner

Fixed by PR #12.

Fixed by PR #12.
MicheleC closed this issue 2 weeks ago
MicheleC added this to the R14.0.10 release milestone 2 weeks ago
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.