Last active
December 13, 2015 17:08
-
-
Save toddejohnson/4944974 to your computer and use it in GitHub Desktop.
Patch for connectbot master to support tfxxx keyboard. Needs work for detection. Based upon https://github.com/hach-que/ConnectBot/blob/master/src/org/connectbot/keyboard/TF300TKeyboard.java.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/org/connectbot/service/TerminalKeyListener.java b/src/org/connectbot/service/TerminalKeyListener.java | |
index b825e6b..6ba8527 100644 | |
--- a/src/org/connectbot/service/TerminalKeyListener.java | |
+++ b/src/org/connectbot/service/TerminalKeyListener.java | |
@@ -160,6 +160,17 @@ | |
} else if(keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) { | |
bridge.decreaseFontSize(); | |
return true; | |
+ } else if(keyCode == KeyEvent.KEYCODE_BACK) { | |
+ // Check to see whether this is the back button on the | |
+ // screen (-1) or whether it's the back button on the | |
+ // keyboard. We only want to treat the keyboard back | |
+ // as ESC. | |
+ if (event.getDeviceId() != -1){ | |
+ // Simulate the back key press. | |
+ sendEscape(); | |
+ return true; | |
+ } | |
+ return false; | |
} | |
// skip keys if we aren't connected yet or have been disconnected | |
@@ -228,11 +239,13 @@ | |
uchar = keyAsControl(uchar); | |
} | |
+ // REMOVE FOR TF300 Breaks symbols on numbers!!! | |
// handle pressing f-keys | |
- if ((hardKeyboard && !hardKeyboardHidden) | |
+ /*if ((hardKeyboard && !hardKeyboardHidden) | |
&& (curMetaState & KeyEvent.META_SHIFT_ON) != 0 | |
&& sendFunctionKey(keyCode)) | |
return true; | |
+ */ | |
if (uchar < 0x80) | |
bridge.transport.write(uchar); | |
@@ -244,8 +257,9 @@ | |
return true; | |
} | |
+ // Broken case?? Makes ctrl work on TF300T | |
// send ctrl and meta-keys as appropriate | |
- if (!hardKeyboard || hardKeyboardHidden) { | |
+ if (hardKeyboard || hardKeyboardHidden) { | |
int k = event.getUnicodeChar(0); | |
int k0 = k; | |
boolean sendCtrl = false; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment