Subject: AltGr not working with external keyboard on Android emacs-30.0.50-29-arm64-v8a

From: Emilia Blåsten <[email-masked]>
Date: Fri, 23 Feb 2024 11:57:00 +0200

The AltGr button does not seem to be recognized properly on Scandinavian
external keyboard layouts, wether connected by USB or Bluetooth. This
happens in Emacs version 30.0.50 on Android, filename
emacs-30.0.50-29-arm64-v8a.apk from

https://sourceforge.net/projects/android-ports-for-gnu-emacs/files/termux/

Steps to reproduce:

1) Connect an external keyboard to the Android device

2) Set the layout to Scandinavian (e.g. in Android 11, settings ->
system -> language and input -> physical keyboard -> name of the
keyboard -> setup keyboard layouts -> remove all layouts except Finnish)

3) Open emacs with the "emacs -Q" option

4) in *scratch* press down the AltGr-key (right side of the space bar),
then the 2-key, then release both, then press the a-key.

Expected behaviour: you should have typed "@a"

Actual behaviour: you typed "aa"

The keyboard behaves like expected in Termux and Android text fields.

Is there an option to fix this already, or is this a bug?

Best regards,
Emilia