It turns out that keyCode was set to the correct character value (for example, 'C'). However, the result of getUnicodeChar () was 0 because the CTRL was held.
All that was needed was to add processing to get the unicode character, regardless of the meta keys that are held with:
if (event.isCtrlPressed()) event = new KeyEvent(KeyEvent.ACTION_DOWN, keyCode);
Then later it was necessary to encode the information "CTRL held" in the transmitted key data, which was already functional, provided by the ConnectBot code.
source share