In iPhone if I am using French or Korean keyboards, both have this streamline composition behavior, e.g., if I press the accent key marked in the image it updates the last character with the correct accent, not necessarily the one displayed in the image.
I want to implement a similar functionality for Portuguese keyboards, where a single key can infer and put the correct accent in the previous character, like ‘á’ or ‘ã’. What is the name of the protocol or some references on building this kind of layout. Not necessarily implement on an iPhone, if I can implement in my Linux is enough.