Hi all,
here is a quick update of what I have tried and found out so far:
1. Technically, handling simple character inputs such as `á` or `^` is feasible with pretty low effort:
![image](https://github.com/squeak-smalltalk/squeak-object-memory/assets/38782922/fb9...)
However, the fact that we are receiving _first_ a regular keystroke and _then_ the combining character makes it impossible to handle dead/composition key inputs properly in general. For example, the user might type <kbd>^</kbd> + <kbd>Backslash</kbd> (which should result in no new character) or <kbd>`</kbd> + <kbd>Home</kbd> (which should result in a single grave character without shifting the cursor). It might be possible to achieve that by using a second, more fine-grained command history, but that would clearly be a dirty hack.
2. I wonder how other applications handle this. I have found surprisingly few information about this feature in general so I could not even research other implementations, simply because I lack the right vocabulary. This blog post was the only real resource I found: https://blog.gtk.org/2021/02/18/gtk-happenings/#:~:text=depth%20and%20structure.-,Better%20Input,-GtkIMContextSimple%20is%20the
As an attempt, this new dead key behavior seems to be an alternative _input method_ that is part of the _Gnome_ _desktop environment (DE)_ or its _GTK (Gnome Toolkit)_. Sorry, I'm all new to headful Linux. :-)
We have seen this issue at least for Qwertz keyboards (German) using Gnome/Ubuntu 22 and ABNT2 keyboards (Portuguese) using Gnome (unknown Linux distribution).
3. Despite further information about idiomatic implementations, I do not know whether the events we get from the VM are correct in the first place, but I tend to doubt it: First, even the first (compose) keyboard input is only sent after pressing the second key, which essentially undermines the idea of the new input method, and second, the order of keyboard events is impractical (see 1.).
4. Currently, I see two possible ways to proceed:
1. Work with what we get by detecting pairs of <any key> followed by <combining character> directly in the `EventSensor>>#fetchMoreEvents`, effectively converting them into a single regular keyboard event for the entire image.
Caveats: Does not really embrace the new concept. There might be no guarantee that the VM provides both events without an intermediary `EventTypeNone`.
2. Study the implementation in the VM and the documentation of GTK/X11 (whatever is responsible for that).
For now, I am just dropping these notes here 1) because I will have to suspend this work and resume it later and 2) because I (quite desperately) hope that someone on the list has a better understanding of these input method semantics and could share it with me or point me to some resources or best practices for handling dead keys in Linux.
(/cc @marceltaeumel @dtlewis290)