Alt Gr problems on Brazilian Portuguese keyboard

Hello, everyone, this is my first post here as I wasn’t able to find a solution to this anywhere. I’m using KDE and the latest version of Tumbleweed as of today (Snapshot 20250121).

This pt-br keyboard is a 86-key with a lot of symbols (like ; : \ |) on the level 3 shift of some keys (using Alt Gr, the R Alt key), that new model with the Microsoft Copilot key instead of the right click key. But randomly, with the symbols I added on the parentheses above, the key is spammed until I press them again, and this blocks the cursor as well until I press the keys once again. This doesn’t happen with special characters like æ, only with those symbols.

I’m thinking this is a KDE issue since I’ve used an Ubuntu Live CD with GNOME and the issue didn’t happen, so it’s not a hardware issue as well. Any suggestions? I tried changing the keyboard model, adding the layout manually, but it kept happening.

I am not sure, but aren’t you better served on the Portuguese part of this forums. More chance to meet people that use (Brazilian) Portuguese keyboards then here in the English section?

I’ll post that there as well, thanks for the suggestion. I’ve posted it here hoping the users from languages that have special characters could chime in if possible

Hi

Hope this helps…

AN-Answer

To set up an 86-key PT-BR keyboard layout on openSUSE Tumbleweed with KDE, you do not need a specific keyboard driver. Instead, you should configure the correct keyboard layout in the system settings. Here’s how you can do it:

  1. Using KDE System Settings:
  • Open System Settings.
  • Navigate to Input Devices > Keyboard > Layout.
  • Enable the checkbox for “Configure Layouts”.
  • Click Add, then search for and select Portuguese (Brazil).
  • Remove any other layouts if you want PT-BR to be the default.
  1. Using YaST:
  • Open YaST and go to the Hardware > Keyboard Layout section.
  • Select Portuguese (Brazil) from the list and apply the changes.
  1. Ensure Proper Locale Settings:
  • Verify that your system locale is set to PT-BR. You can check this in YaST > System > Language or by editing locale configuration files.

I realise you have probably already tried the above, it is posted more as a reminder in case you missed a step, or it did not register.

But my system is in English, how can I change the locale while keeping the language?

This happens to me every now and then on pretty vanilla US keyboard, usually in VM. Whatever software is handling keyboard misses key release. It usually happens when the system is busy for whatever reason.

I do not think there is magical one click universal solution. One would need to identify the component that is affected and report to developers. It could be kernel; it could also be user space (Xorg or Wayland compositor). But collecting data for something that happens only sporadically is difficult.

It’s not that sporadic, it happens 1 out of 3 times I press the keys haha. That’s why it’s so annoying, specially when dealing with coding or spreadsheets

Are you using X11 or Wayland?

Then do not change anything on the system level with respect of the locale.
But I assume you must tell your system what keyboard you use, else it would not know what character to create which what key (combination) pressed).

For a user using a desktop, each user can of course use her/his own locale. But again, I assume that it still needs to know what keyboard is connected.

I other words, I have no idea why @clive is suggesting to change things on the locale/language level. Those have nothing to do with keyboard input. They influence output (like messages in the proper language, formatting numbers, formatting date/time, etc.)

Hi

YAST
Keyboard Layout

In the English Locale, I have English (UK) selected.

Further down are 2 that may be relevant…

Portugese (Brazil)
Portugese (Brazil – American accents)

I dare not really test my own system, but at the bottom of the screen is a keyboard test area you can use before committing.

The issue happens on both, but I’m using X11

Again, this is NOT about locale (that defines things on text output) (first part of your post). It is about telling the system what the hardware of the keyboard is so that correct input can be generated (second part of your post).
Please do not mix those two very different subjects .

And for characters not direct available on a keyboard (like accented ones) one can use in e.g. KDE the compose key. I have the compose key set to RightCtrl. Thus typing RightCtrl followed by two (rather local) characters I get e.g.
’ e for é
" a for ä
, c for ç
= e for €
a e for æ (an example of the OP)
o a for å
. I for İ (Turkish capital letter)

I realized it’s got something to do with the keyboard model in the settings, actually. I’ve set up a GNOME Tumbleweed live USB and got the cursor locking problem still, not the repeating keys though

Ok, testing with the graphical preview of the keyboard I realized that the issue happens when I let go of Alt Gr too quickly. I tried increasing the delay for repeat to 2400 ms and the issue still happens. Guess I’ll need to reeducate myself on the speed I type, maybe ¯\_(ツ)_/¯

Unlikely. Keyboard model affects which keys are available and their layout. Incorrect model may result in missing characters or characters in unexpected location but unlikely in stuck keys.

Try checking what events are delivered by kernel. You can use e.g. libinput. Use libinput list-devices to find your keyboard and then libinput record --show-keycodes /dev/input/eventX some-output-file.yml. Are all key presses and releases recorded? E.g.

bor@bor-Latitude-E5450:~$ sudo libinput list-devices
...
Device:           AT Translated Set 2 keyboard
Kernel:           /dev/input/event4
...
bor@bor-Latitude-E5450:~$ sudo libinput record --show-keycodes /dev/input/event4 /tmp/keyboard.yml
Recording to '/tmp/keyboard.yml'.
Receiving events: [        *            ]^C

The file contains a lot of details, in particular

  events:
  # Current time is 20:46:13
  - evdev:
    - [  0,      0,  17,   2,       1] # EV_LED / LED_SCROLLL               1
    - [  0,      0,   0,   0,       0] # ------------ SYN_REPORT (0) ---------- +0ms
  # Current time is 20:46:15
  - evdev:
    - [  2, 489522,   4,   4,     184] # EV_MSC / MSC_SCAN                184
    - [  2, 489522,   1, 100,       1] # EV_KEY / KEY_RIGHTALT              1
    - [  2, 489522,   0,   0,       0] # ------------ SYN_REPORT (0) ---------- +2489ms

Here I pressed the AltGr (1 in the last column)

  - evdev:
    - [  2, 612954,   4,   4,       9] # EV_MSC / MSC_SCAN                  9
    - [  2, 612954,   1,   9,       1] # EV_KEY / KEY_8                     1
    - [  2, 612954,   0,   0,       0] # ------------ SYN_REPORT (0) ---------- +123ms

I pressed 8 while still keeping AltGr down.

  - evdev:
    - [  2, 754222,   4,   4,       9] # EV_MSC / MSC_SCAN                  9
    - [  2, 754222,   1,   9,       0] # EV_KEY / KEY_8                     0
    - [  2, 754222,   0,   0,       0] # ------------ SYN_REPORT (0) ---------- +142ms

8 was released (0 in the last column)

  - evdev:
    - [  2, 789221,   4,   4,     184] # EV_MSC / MSC_SCAN                184
    - [  2, 789221,   1, 100,       0] # EV_KEY / KEY_RIGHTALT              0
    - [  2, 789221,   0,   0,       0] # ------------ SYN_REPORT (0) ---------- +35ms

AltGr was released.

Events resulted from auto-repeat will have 2 in the last column.

Hi
@hcvv
I will try to avoid annoying you anymore and will refrain from posting and participating, as that seems to be the best I can do.