From 1878e0cdaef13e13cb84b8a69bd4a621f8b6c00a Mon Sep 17 00:00:00 2001 From: "Paul \"LeoNerd\" Evans" Date: Sat, 21 Mar 2015 19:26:56 +0000 Subject: Cope with keymaps that don't understand ALT modifier by falling back on the un-modified Unicode char if it is unknown with --- src/org/connectbot/service/TerminalKeyListener.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') 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; -- cgit v1.2.3