diff options
author | Paul "LeoNerd" Evans <leonerd@leonerd.org.uk> | 2015-03-21 19:26:56 +0000 |
---|---|---|
committer | Paul "LeoNerd" Evans <leonerd@leonerd.org.uk> | 2015-03-21 19:26:56 +0000 |
commit | 1878e0cdaef13e13cb84b8a69bd4a621f8b6c00a (patch) | |
tree | f05e079b17a3398e8f1ad455b04580fce9f0de67 /src | |
parent | 96dde0739689ce6978221d8d7876e824a947f7f9 (diff) | |
download | connectbot-1878e0cdaef13e13cb84b8a69bd4a621f8b6c00a.tar.gz connectbot-1878e0cdaef13e13cb84b8a69bd4a621f8b6c00a.tar.bz2 connectbot-1878e0cdaef13e13cb84b8a69bd4a621f8b6c00a.zip |
Cope with keymaps that don't understand ALT modifier by falling back on the un-modified Unicode char if it is unknown with
Diffstat (limited to 'src')
-rw-r--r-- | src/org/connectbot/service/TerminalKeyListener.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/org/connectbot/service/TerminalKeyListener.java b/src/org/connectbot/service/TerminalKeyListener.java index 7ff21df..43bd8e0 100644 --- a/src/org/connectbot/service/TerminalKeyListener.java +++ b/src/org/connectbot/service/TerminalKeyListener.java @@ -292,7 +292,11 @@ public class TerminalKeyListener implements OnKeyListener, OnSharedPreferenceCha int uchar = event.getUnicodeChar(derivedMetaState & ~HC_META_CTRL_MASK); int ucharWithoutAlt = event.getUnicodeChar( derivedMetaState & ~(HC_META_ALT_MASK | HC_META_CTRL_MASK)); - if (uchar != ucharWithoutAlt) { + if (uchar == 0) { + // Keymap doesn't know the key with alt on it, so just go with the unmodified version + uchar = ucharWithoutAlt; + } + else if (uchar != ucharWithoutAlt) { // The alt key was used to modify the character returned; therefore, drop the alt // modifier from the state so we don't end up sending alt+key. derivedMetaState &= ~HC_META_ALT_MASK; |