yogeshdh / connectbot

Automatically exported from code.google.com/p/connectbot
Apache License 2.0
0 stars 0 forks source link

Ctrl, Alt and ESC keys not working on bluetooth keyboard #369

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Use bluetooth HID stack from cyanogenMod firmwares
2.Any bluetooth HID keyboard
3.

What is the expected output? What do you see instead?
Ctrl, Alt and ESC keys (on the keyboard) don't work.

What version of the product are you using (you can see this by using Menu
-> About in the Host List)?
connectBot stable (from market)

What type of system are you trying to connect to?
linux ssh

If you are able to connect, what is the output of "echo $TERM", "uname -a",
and any other relevant information on the host?

Please provide any additional information below.

I don't know if this is a connectBot issue, a bluetooth stack issue or an IME 
issue. It would be nice to have all keyboard keys working (Ctrl, Alt and ESC) 
with a real bluetooth keyboard.

Using the phone pad to do ctrl works, but it is unusable.

Original issue reported on code.google.com by sophan...@gmail.com on 27 Sep 2010 at 4:51

GoogleCodeExporter commented 8 years ago
>"How did you test it, what output did you get and what you expected?"

Using ConnectBot-ext-keyboard-0-g815d488-debug on Thinkpad Tablet running 
Android 3.1, kernel 2.6.36.3.

With Rii N7:

Steps to reproduce:
1. Connected Rii N7 via USB transceiver
2. Opened a connection by unlocking a key and waiting for a bash prompt to 
appear
3. Typed in "test"
4. Hit ctrl+a

Expected results:
The text caret moves to the beginning of the line

Actual Results:
The text caret remained where it was. No text was entered (i.e., no erroneous 
"a" as entered). 

Dump from keytest while pressing ctrl:
> Keycode: 113
> KeyEvent: KeyEvent{action=ACTION_DOWN keycode=KEYCODE_CTRL_LEFT scancode=29 
metaState=META_CTRL_ON|META_CTRL_LEFT_ON flags=0x8 repeat=0 device=19 
source=0x101}

Dump from keytest while pressing ctrl+a:
> Keycode: 29
> KeyEvent: KeyEvent{action=ACTION_DOWN keycode=KEYCODE_A scancode=30 
metaState=META_CTRL_ON|META_CTRL_LEFT_ON flags=0x8 repeat=0 device=23 
source=0x101}

With USB Thinkpad Tablet Keyboard Folio Case:

Steps to reproduce: 
Same as above

Results:
1. Immediately after depressing the a key when pressing ctrl+a, an "a" is 
inserted. (i.e., "testa")
2. After releasing the depressed ctrl key, the menu appears

Expected Results:
1. Text caret moves to beginning of line, no "a" inserted
2. The menu doesn't appear. 

On the keyboard folio case, the keycap for the control key is inscribed with 
both "Ctrl" and the Android menu icon, indicating, presumably, that it 
functions as a menu button when not used as a control. 

Dump from keytest for ctrl on keyboard from keyboard folio case:
> Keycode: 82
> KeyEvent: KeyEvent{action=ACTION_DOWN keycode=KEYCODE_MENU scancode=139 
metaState=0 flags=0x8 repeat=0 device=22 source=0x101}

Original comment by 100Dash...@gmail.com on 2 Oct 2011 at 6:39

GoogleCodeExporter commented 8 years ago
Thanks for detailed report. Few things I see from it. First of all, Lenovo 
Thinkpad Tablet is Android 3.x device, and 3.x has native Control keys support, 
and handling that already included in ConnectBot upstream. It's very strange it 
doesn't work for you (but I don't have 3.x device and never tested it).

Otherwise:

Rii N7:
KeyEvent: KeyEvent{action=ACTION_DOWN keycode=KEYCODE_CTRL_LEFT scancode=29 
metaState=META_CTRL_ON|META_CTRL_LEFT_ON flags=0x8 repeat=0 device=19 
source=0x101}

3.x CTRL state is reported as expected, and scancode is correct for Left Ctrl 
(my code would recognize it).

Does Rii have Right Ctrl and would you be able to post KeyEvent for it?

USB Thinkpad Tablet Keyboard Folio Case:

KeyEvent: KeyEvent{action=ACTION_DOWN keycode=KEYCODE_MENU scancode=139 
metaState=0 flags=0x8 repeat=0 device=22 source=0x101}

This is completely mad, you see. Scancode (0x8b) is unknown to 
http://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html (way above nornal range), 
and keycode generated is for menu, so menu you get.

Summing up:
Rii not working is weird. Did you try pristine ConnectBot? Tablet branch? I 
will look if my patch might interact badly with Honeycomb CTRL handling (though 
I already tried to write is so that scancode handling happens as the last 
resort, if nothing else processed a key before).

Folio case not working is the result of typical OEM braindeadness (you can see 
other examples in AC100 pull request above). It would be possible to make it 
work by  extending my scancode patch (but first need to figure out why it 
doesn't work for you of course).

Original comment by pmis...@gmail.com on 2 Oct 2011 at 7:05

GoogleCodeExporter commented 8 years ago
According to Linux kernel:

#define KEY_MENU         139

So, it's not random scancode, the vendor *wanted* that key to be menu, so there 
it is. Are you sure it's a Ctrl key at all? ;-)

Original comment by pmis...@gmail.com on 2 Oct 2011 at 7:09

GoogleCodeExporter commented 8 years ago
Just tried 
http://sourceforge.net/projects/chdistro-droid/files/ConnectBot-ext-keyboard/  
on my Acer a500 with a logitech usb keyboard : does not seems to work at all

Can't abord a ping request using ctrl + c

keytest confirm that correct scancode are received

Original comment by pfo...@gmail.com on 6 Oct 2011 at 10:58

GoogleCodeExporter commented 8 years ago
Looks to me as if TerminalKeyListener is only trying to process Ctrl keys when 
there is no hardware keyboard.

Similarly, shift-number keys aren't working with a hardware keyboard because it 
is inappropriately using sendFunctionKey() to deal with them.

The following patch appears to fix both issues on my Xoom/Motorola Bluetooth 
Keyboard combo; but I'm not sufficiently familiar with the Connectbot codebase, 
or Android development in general to know what I might have broken in the 
process (which is why I feel it is appropriate to put it inline rather than 
make it all-too-easy to apply).  Note that while the Ctrl-key combinations now 
work, they're *also* recognized as menu accelerators  :(

diff --git a/src/org/connectbot/service/TerminalKeyListener.java 
b/src/org/connectbot/service/TerminalKeyListener.java
index 6330479..3e15d1e 100644
--- a/src/org/connectbot/service/TerminalKeyListener.java
+++ b/src/org/connectbot/service/TerminalKeyListener.java
@@ -251,12 +251,6 @@ public class TerminalKeyListener implements OnKeyListener, 
OnSharedPreferenceCha
                                        key = keyAsControl(key);
                                }

-                               // handle pressing f-keys
-                               if ((hardKeyboard && !hardKeyboardHidden)
-                                               && (curMetaState & 
KeyEvent.META_SHIFT_ON) != 0
-                                               && sendFunctionKey(keyCode))
-                                       return true;
-
                                if (key < 0x80)
                                        writeToBridge(key);
                                else
@@ -266,8 +260,7 @@ public class TerminalKeyListener implements OnKeyListener, 
OnSharedPreferenceCha
                                return true;
                        }

-                       // send ctrl and meta-keys as appropriate
-                       if (!hardKeyboard || hardKeyboardHidden) {
+                       if (true) {
                                int k = event.getUnicodeChar(0);
                                int k0 = k;
                                boolean sendCtrl = false;

Original comment by litan...@gmail.com on 7 Oct 2011 at 6:37

GoogleCodeExporter commented 8 years ago
>I tried this version:
>http://sourceforge.net/projects/chdistro-droid/files/ConnectBot-ext-keyboard/

>ctrl, alt, tab, esc all work on my htc desire with bluetooth keyboard.

confirmed on HTC Rezound with Zippy BT500 keyboard.

Issue: shift-numeric keys are broken:

Shift-1 = ! and shift-4=$ are broken when using VI... I can't force quite VI 
(without saving) ... bummer!

Hope this is an easy fix?

Thanks for the good work!

Original comment by sniem...@gmail.com on 24 Dec 2011 at 9:27

GoogleCodeExporter commented 8 years ago
Bought a dell Y-RAQ-DEL2 aka GM952 for $25 on eBay.
Google Nexus Galaxy ICS 4.0

In ConnectBot none of the shift keys ex: shift 1 "!" through shift 0 ")" - the 
phone just buzzes like I pressed an invalid key. The numeric keypad does work 
as :"<>? all work.

The shift keys DO work in the Gmail app on the phone making me think this is 
limited to a connectbot issue. 

Original comment by gru3hun...@gmail.com on 4 Jan 2012 at 7:05

GoogleCodeExporter commented 8 years ago
r u making love to me? It is a connectbot issue.  The code that does this 
appears to be in the yourdir/connectbot/de/mud/ directory in a file containing 
some "function declarations" ( to this old C programmer who ain't programmed in 
a decade or so Don't know or care what it's called in Java). Both the mouse 
coordinate handling, and the keyboard handling including over-ride for ctrl 
keys. 

from the connectbot source code:
/connectbot/src/de/mud/terminal/VDUInput.java

line 4 :

* (c) Matthias L. Jugel, Marcus Meißner 1996-2005. All Rights Reserved.

QUESTION is this the copyright notice date for the file itself? Damn that's an 
old file, 1996 I had only been a slackware (l)user for a year. I had hair, that 
was long ago. Now I'm an old bald (l)user. time flies. 

 then the GNU license, then this 

 /**
   * Handle key Typed events for the terminal, this will get
   * all normal key types, but no shift/alt/control/numlock.
   * @param keyCode the key code
   * @param keyChar the character represented by the key
   * @param modifiers shift/alt/control modifiers
   */
  void keyTyped(int keyCode, char keyChar, int modifiers);
}

At first glance the code that gives crtl and esc functions from trackball may 
be redundant to commenting out one declaration. Rarely that simple though. 
Anybody here not too lazy to run this change through eclipse? I'd need another 
six hours of reading - NEVER used eclipse. vi/perl kind of dog here and that in 
the last century. Anyone save a lazy old man from doing some useful shinola? 
kids? hello? :) 

 I need a GNU phone, what the chicken rice soup is all this Java needed for? "Yeah, we got GNU/Linux running on the ARM processors from work started in the late nineties, so it's stable and mature. Hey! I got an idea, lets use an "application framework"!! WRITTEN IN JAVA!! cue Mickey Rooney/Judy Garland media file....... Yeah a virtual machine! It'll virtually be the best virtual machine ever! and so on. 

  I mean it's better (slightly ** from an ethical standpoint as well as technical ) than CE or Apple. BUT why are we using a language we can't hack on top of an operating system we did? Doesn't the Java license kind of sort of prevent users from studying/modifying the internals of Java to suit their own purposes and see how it works? That's not how I like to get down. YMMV

  Anyway, I'm going back to working on dual boots and str8 up gnu/linux distros on my droid hardware. Hopefully will only be using android when I have to use a mobile phone. Still can't understand why those aren't obsolete either, but that's my radio nerd rant. Maybe another time. 

Original comment by beatty.d...@gmail.com on 7 Jan 2012 at 9:06

GoogleCodeExporter commented 8 years ago
@beatty.d...@gmail.com, this was LOVELY, thank you!

Original comment by michal....@gmail.com on 7 Jan 2012 at 9:30

GoogleCodeExporter commented 8 years ago
You are welcome Michael. I've been waiting for my gnu/linux palmtop with phone 
since I read Sam's "Linux Unleashed, Slackware 2.0". Still waiting.

QUESTION? Is there some valid reason to smubosh the ctrl/alt/esc keys in an ssh 
session? Looks to me like the code came from a Java Terminal project of some 
kind that predates Android.

  Could it be something like the BBS operators did back in the days of yore to keep folks from crashing the board and gaining control of the box? 

   I'm still trying to figure out where VDUINput.java came from and why they did that. Almost at the point where I'll try to map foo/bar/baaz to crtl/alt/esc. 

 Apparently they keep their dead at  http://javatelnet.org/ .... I'm starting here. http://javatelnet.org/space/Docs+and+Tutorials  The site ain't been updated in seven years. At least it's GNU licensed. 

Original comment by beatty.d...@gmail.com on 8 Jan 2012 at 12:15

GoogleCodeExporter commented 8 years ago
Just tried the same test with a logitech tablet keyboard Android 3.0+ 
930-003390 and it does the same thing (no ctrl/esc, no shift #'s)

Also tried the latest developer build, and the ChDistro Ext Keyboard for 
Connectbot 
sourceforge.net/projects/chdistro-droid/files/ConnectBot-ext-keyboard/ and it 
does not work either.

Original comment by gru3hun...@gmail.com on 12 Jan 2012 at 1:25

GoogleCodeExporter commented 8 years ago
Note: This issue persists with Android 4.

Logitech Bluetooth ( 
http://www.logitech.com/en-za/gaming/mice-keyboard-combos/devices/3616 ) and 
Galaxy Nexus with Android 4.0.2 adn Connectbot 1.7.1 2010.10.08

I'll try connectbot-ext-keyboard later.

Original comment by j...@aims.ac.za on 17 Jan 2012 at 8:25

GoogleCodeExporter commented 8 years ago
Update: Android4

I yesterday installed
http://sourceforge.net/projects/chdistro-droid/files/ConnectBot-ext-keyboard/

The tab and alt keys work now, control does not. I have hackerskeyboard 
installed,
and a tap on screen brings up the control, escape, and keyboard icons, and 
after clicking control, the hardware keyboard control does send control. This 
is still quite inconvenient compared to a hardware keyboard's control key 
working.

Original comment by j...@aims.ac.za on 18 Jan 2012 at 9:03

GoogleCodeExporter commented 8 years ago
No luck with Ctrl key with a Motorola Bluetooth Keyboard on a Motorola XOOM 
Wi-Fi tablet.

Original comment by neilalexanderr on 25 Jan 2012 at 11:06

GoogleCodeExporter commented 8 years ago
ConnectBot-ext-keyboard package mentioned above works just GREAT with
Samsung Galaxy i9000 and Freedom Keyboard Pro. I feel the power of
this small machine again, typing this over links with byobu enabled.
Everything works as expected, THANK YOU THANK YOU THANK YOU.

2012/1/26, connectbot@googlecode.com <connectbot@googlecode.com>:

Original comment by michal....@gmail.com on 26 Jan 2012 at 8:05

GoogleCodeExporter commented 8 years ago
Galaxy Nexus ICS 4.0.2 and freedom pro keyboard does not work for the top row 
keys like ! And # with the anroid market version of connectbot; however, keys 
work fine in other apps like google.docs for instance.

Original comment by gvid...@gmail.com on 26 Jan 2012 at 1:08

GoogleCodeExporter commented 8 years ago
Have gotten Xoom and BT keyboard working in following way -- start ConnectBot 
(tablet version) without BT keyboard; ssh to server; leave ConnectBot (e.g., go 
to home screen); connect to BT keyboard; go back to ConnectBot; everything 
works.  Not sure why that is needed, but it works.

Original comment by clark...@gmail.com on 26 Jan 2012 at 3:24

GoogleCodeExporter commented 8 years ago
I can confirm that ConnectBot-ext [1]_ works with Apple Wireless
Keyboard [2]_ on my Samsung Galaxy S2 [3]_ and provides full use of
Ctrl, Alt, function keys, and most importantly, Esc. (Tested on a
Samsung Galaxy S2).

Results with the same ConnectBot-ext [1]_ on with the Samsung Galaxy
Tab 10.1 Bluetooth Keyboard Case [4]_ on my Samsung Galaxy Tab 10.1
[5]_ are less stellar: Esc and function keys work, but Ctrl does not.

- Robert

PS - Is there a wiki we can collate a compatibility table on? I lack
permission to create a wiki page on [1]_.

.. [1] 
http://sourceforge.net/projects/chdistro-droid/files/ConnectBot-ext-keyboard/
(g815d488)
.. [2] http://www.apple.com/uk/keyboard/
.. [3] Android v2.3.3
.. [4] http://www.samsung.com/us/mobile/galaxy-tab-accessories/BKC-1B1USBGSTA
.. [5] Android v3.1

Original comment by robert.m...@gmail.com on 5 Feb 2012 at 2:52

GoogleCodeExporter commented 8 years ago
Connectbot-ext-keyboard also works great for me (CTRL and Tab function 
correctly) with external USB keyboard (built into case) with a generic Chinese 
tablet, Tabtronics M009SC running Android 2.3.4.

Original comment by peanut9...@gmail.com on 7 Feb 2012 at 1:05

GoogleCodeExporter commented 8 years ago
2 robert.m... : It's for sure good idea to collect the compatibility data, and 
it would be even more useful if accompanied by output from 
http://github.com/chrisboyle/keytest/downloads (for cases it doesn't work). I'm 
not sure what would be the good place to collect that info. chdistro-droid 
project, where ConnectBot-ext-keyboard happens to be hosted, is dedicated to 
other topic, so I'm not sure if it's worth to put such data there. All in all, 
if you'd start such a wiki page somewhere with public access, just post it 
here, that would be good step.

Original comment by pmis...@gmail.com on 7 Feb 2012 at 1:25

GoogleCodeExporter commented 8 years ago
Hackerskeyboard is a tremendous find! It doesn't fix the problems with the
external keyboard, but it is a vast improvement over the stock soft
keyboard that comes with Android. Wow!

KB

Original comment by kbcm...@gmail.com on 7 Feb 2012 at 5:44

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
The solution posted inside COMMENT 67 works. I have XOOM (android 4.0) + 
Logitech BT keyboard. The following functions are working
1) ESC
2) CTRL
3) Shift+numerical keys !@#$%^&*()

Original comment by greatest...@gmail.com on 14 Mar 2012 at 4:30

GoogleCodeExporter commented 8 years ago
The solution posted inside COMMENT 55 seems to be a better solution. I 
recompiled the code by using the latest build (on 3/14/2012) and combining the 
code inside COMMENT 55. 
The following keys are verified on XOOM (Android 4.03)+Logitech BT keyboard:
1) ESC
2) TAB
3) Shift + Numerical Keys !@#$%^&*()

Original comment by greatest...@gmail.com on 14 Mar 2012 at 7:23

Attachments:

GoogleCodeExporter commented 8 years ago
FYI: I'm using ConnectBot-git-tablet-2011-12-19_18-30-54.apk with an Acer A500 
tablet and an external bluettoth "ZAGGkeys Flex" keyboard and the TAB and CRTL 
keys work fine. There is no escape key, but CTRL-[ works. The shift/numerical 
keys work too.

Original comment by anth...@bifb.org on 26 May 2012 at 9:59

GoogleCodeExporter commented 8 years ago
I also have a freedom pro wireless bluetooth keyboard and just got a nexus 7. I 
cannot get Tab, Esc, or Ctrl to work properly without using the onscreen Ctrl 
or Esc (and using the onscreen Ctrl and then pressing 'i' on the keyboard for 
tab) this really limits how much I can get done on connectbot.

Original comment by IAmCor...@gmail.com on 20 Jul 2012 at 11:18

GoogleCodeExporter commented 8 years ago
This if for the the Samsung Galaxy tab 10.1 using the official samsung keyboard 
dock

I find if you change the soft keyboard from Samsung to the Android default, 
then the Ctrl key works in connectbot while ssh'd into linux.

Now, to figure out how to map ESC to one of the keys....

Original comment by Albright...@gmail.com on 3 Aug 2012 at 4:29

GoogleCodeExporter commented 8 years ago
Well I wish that was the case with the Logitech Android Tablet Keyboard and a 
Nexus 7, as control doesn't work here. It would be nice if it did... It 
wouldn't be so bad if there was a way to simulate Ctrl on a soft keyboard...

Original comment by ramer...@gmail.com on 3 Aug 2012 at 4:44

GoogleCodeExporter commented 8 years ago
Last update:  I got the ESC key working on the attached keyboard (Galaxy Tab 
10.1 wifi).

I installed busybox on my rooted Tab, and edited system/usr/keylayout/querty.kl

From there, I added the line "key 1     SEARCH" underneath "key399 GRAVE"

I then commented out "key 127 SEARCH" and "key 217 SEARCH" because I will never 
use that button ever for anything else.

Boom bam shazam, the goofy search key on my keyboard dock now sends ESC instead 
of search commands - which is all I ever wanted.  Let the SSH fun begin!

Original comment by Albright...@gmail.com on 3 Aug 2012 at 4:45

GoogleCodeExporter commented 8 years ago
ramercer, download the APK KeyEvent Display - it (should) tell you the internal 
bindings to the ctrl key.

You can find all of android's internal keycodes here: 
http://developer.android.com/reference/android/view/KeyEvent.html

If it's registering to a key, it should show up in there.  My keyboard 
registered it as the 'standard' keycode 113 - which through some automagic, 
ties into the .kl file to key 29 (in Generic.kl).

Since I don't own either of those devices, I can't really test it out, but I 
wish you luck!

Original comment by Albright...@gmail.com on 3 Aug 2012 at 4:51

GoogleCodeExporter commented 8 years ago
I'm also trying to solve this problem on the Nexus 7.  I tried a couple of the 
apks noted above -- but they just land me on a "No host currently connected" 
screen and I don't see a way to get out to the normal user@host specification 
screen.  In fact, even after wiping the data for connectbot and uninstalling, 
I'm not getting back to the normal connectbot startup (tutorial) sequence.  My 
goal is to find the version that solves the bluetooth hardware keyboard issues, 
and also works properly without the bluetooth keyboard.  Any clues?  Thanks!

Original comment by lauren4...@gmail.com on 19 Aug 2012 at 6:46

GoogleCodeExporter commented 8 years ago
not working on bluetooth keyboard

of the apks noted above -- but they just land me on a "No host currently
connected" screen and I don't see a way to get out to the normal
user@hostspecification screen.  In fact, even after wiping the data
for connectbot
and uninstalling, I'm not getting back to the normal connectbot startup
(tutorial) sequence.  My goal is to find the version that solves the
bluetooth hardware keyboard issues, and also works properly without the
bluetooth keyboard.  Any clues?  Thanks!

I was in the same boat.

I hurriedly patched the standard (not tablet) brain of the code that I took
off code.google.com and essentially commented out all the special cases
bits that made sense to eliminate. I have no access took my changed source
right now, an vs won't even have Wi-Fi access to send this until tomorrow...

I'm using it with my nexus 7 and a zagg Bluetooth keyboard. (Flex?)
Additionally, I'm using the Android Keyboard Helper Pro, for the purposes
of letting the qwerty keyboard behave as if it dvorak and to assign the
'option' key as an escape key since the keyboard lacks one. (Yes, you could
use ctrl-[ but since I already had the AKHP, i figured I'd use it.)

For the first two days I used my hasty build it was perfect -  I wrote a
few thousand lines of code on the airplane, happily ctrl-w'ing between
panes of vim, life was sweet.

Yesterday night, however, ctrl stopped working solo, and I needed to use
shft-ctrl-<char> to have it work properly. No idea why. Maybe related to
AKHP. Who knows.

Anyway, if you want to try an APK built by a stranger who can't even send
you the patch he used, have at it - it's at

   http://drowsy.ifokr.org/a.apk

Note: it's the first android app I've compiled, I had to touch java to do
it, and I am sure the key that signs it is gibberish and unrelated to my
actual name.  But it does install....

Original comment by b...@extrahop.com on 19 Aug 2012 at 6:49

GoogleCodeExporter commented 8 years ago
I'll give it a try and report back.  My keyboard has ESC (hell, and even 
function keys) so I'll just test it straight.  Thanks!

Original comment by lauren4...@gmail.com on 19 Aug 2012 at 6:56

GoogleCodeExporter commented 8 years ago
Well, the keyboard part of this was looking pretty encouraging, but I 
discovered that your test version (a.apk) won't import my standard private key 
that has always worked with regular connectbot versions.  Getting the "can't 
parse private key" error.  So something must be different there!

Original comment by lauren4...@gmail.com on 19 Aug 2012 at 11:03

GoogleCodeExporter commented 8 years ago
Lame diff follows.

diff --git a/src/org/connectbot/service/TerminalKeyListener.java
b/src/org/connectbot/service/TerminalKeyListener.java
index 952f3cd..4897ee4 100644
--- a/src/org/connectbot/service/TerminalKeyListener.java
+++ b/src/org/connectbot/service/TerminalKeyListener.java
@@ -221,20 +221,23 @@ public class TerminalKeyListener implements
OnKeyListener, OnSharedPreferenceCha
                                        metaState &= ~META_CTRL_ON;
                                        bridge.redraw();

+                    //BRI seems to not fix !@#$
                                        // If there is no hard keyboard or
there is a hard keyboard currently hidden,
                                        // CTRL-1 through CTRL-9 will send
F1 through F9
-                                       if ((!hardKeyboard || (hardKeyboard
&& hardKeyboardHidden))
-                                                       &&
sendFunctionKey(keyCode))
-                                               return true;
+                                       //if ((!hardKeyboard ||
(hardKeyboard && hardKeyboardHidden))
+                                       //              &&
sendFunctionKey(keyCode))
+                                       //      return true;

                                        key = keyAsControl(key);
                                }

+
+                //BRI seems to fix !@#$
                                // handle pressing f-keys
-                               if ((hardKeyboard && !hardKeyboardHidden)
-                                               && (curMetaState &
KeyEvent.META_SHIFT_ON) != 0
-                                               && sendFunctionKey(keyCode))
-                                       return true;
+                               //if ((hardKeyboard && !hardKeyboardHidden)
+                               //              && (curMetaState &
KeyEvent.META_SHIFT_ON) != 0
+                               //              && sendFunctionKey(keyCode))
+                               //      return true;

                                if (key < 0x80)
                                        bridge.transport.write(key);
@@ -274,46 +277,46 @@ public class TerminalKeyListener implements
OnKeyListener, OnSharedPreferenceCha
                        if (hardKeyboard && !hardKeyboardHidden &&
                                        event.getRepeatCount() == 0) {
                                if
(PreferenceConstants.KEYMODE_RIGHT.equals(keymode)) {
-                                       switch (keyCode) {
-                                       case KeyEvent.KEYCODE_ALT_RIGHT:
-                                               metaState |= META_SLASH;
-                                               return true;
-                                       case KeyEvent.KEYCODE_SHIFT_RIGHT:
-                                               metaState |= META_TAB;
-                                               return true;
-                                       case KeyEvent.KEYCODE_SHIFT_LEFT:
-                                               metaPress(META_SHIFT_ON);
-                                               return true;
-                                       case KeyEvent.KEYCODE_ALT_LEFT:
-                                               metaPress(META_ALT_ON);
-                                               return true;
-                                       }
+                                       //switch (keyCode) {
+                                       //case KeyEvent.KEYCODE_ALT_RIGHT:
+                                       //      metaState |= META_SLASH;
+                                       //      return true;
+                                       //case KeyEvent.KEYCODE_SHIFT_RIGHT:
+                                       //      metaState |= META_TAB;
+                                       //      return true;
+                                       //case KeyEvent.KEYCODE_SHIFT_LEFT:
+                                       //      metaPress(META_SHIFT_ON);
+                                       //      return true;
+                                       //case KeyEvent.KEYCODE_ALT_LEFT:
+                                       //      metaPress(META_ALT_ON);
+                                       //      return true;
+                                       //}
                                } else if
(PreferenceConstants.KEYMODE_LEFT.equals(keymode)) {
-                                       switch (keyCode) {
-                                       case KeyEvent.KEYCODE_ALT_LEFT:
-                                               metaState |= META_SLASH;
-                                               return true;
-                                       case KeyEvent.KEYCODE_SHIFT_LEFT:
-                                               metaState |= META_TAB;
-                                               return true;
-                                       case KeyEvent.KEYCODE_SHIFT_RIGHT:
-                                               metaPress(META_SHIFT_ON);
-                                               return true;
-                                       case KeyEvent.KEYCODE_ALT_RIGHT:
-                                               metaPress(META_ALT_ON);
-                                               return true;
-                                       }
+                                       //switch (keyCode) {
+                                       //case KeyEvent.KEYCODE_ALT_LEFT:
+                                               //metaState |= META_SLASH;
+                                               //return true;
+                                       //case KeyEvent.KEYCODE_SHIFT_LEFT:
+                                               //metaState |= META_TAB;
+                                               //return true;
+                                       //case KeyEvent.KEYCODE_SHIFT_RIGHT:
+                                               //metaPress(META_SHIFT_ON);
+                                               //return true;
+                                       //case KeyEvent.KEYCODE_ALT_RIGHT:
+                                               //metaPress(META_ALT_ON);
+                                               //return true;
+                                       //}
                                } else {
-                                       switch (keyCode) {
-                                       case KeyEvent.KEYCODE_ALT_LEFT:
-                                       case KeyEvent.KEYCODE_ALT_RIGHT:
-                                               metaPress(META_ALT_ON);
-                                               return true;
-                                       case KeyEvent.KEYCODE_SHIFT_LEFT:
-                                       case KeyEvent.KEYCODE_SHIFT_RIGHT:
-                                               metaPress(META_SHIFT_ON);
-                                               return true;
-                                       }
+                                       //switch (keyCode) {
+                                       //case KeyEvent.KEYCODE_ALT_LEFT:
+                                       //case KeyEvent.KEYCODE_ALT_RIGHT:
+                                               //metaPress(META_ALT_ON);
+                                               //return true;
+                                       //case KeyEvent.KEYCODE_SHIFT_LEFT:
+                                       //case KeyEvent.KEYCODE_SHIFT_RIGHT:
+                                               //metaPress(META_SHIFT_ON);
+                                               //return true;
+                                       //}
                                }
                        }

Original comment by b...@extrahop.com on 19 Aug 2012 at 11:39

GoogleCodeExporter commented 8 years ago
Looks like the "lorantkurthy" version described here works well on the Nexus 7 
and with my Bluetooth keyboard, including control chars, etc.: 
http://forum.xda-developers.com/showthread.php?t=1163999 // APK at: 
https://github.com/downloads/lorantkurthy/connectbot/ConnectBot.apk is testing 
out well.  Thanks again!

Original comment by lauren4...@gmail.com on 19 Aug 2012 at 11:46

GoogleCodeExporter commented 8 years ago
Grr, with both #86's apk, and the earlier ConnectBot-ext-keyboard I have the 
same problem on my nexus 7.

If I boot -> launch connectbot -> pair keyboard, it all works.  Control-a/e, 
esc sends escape (not back), volume keys work.  Irssi, screen, and vim work 
well.

However if I boot -> pair keyboard -> connectbot it acts like a virtual 
keyboard.  Control and alt don't work.  Esc sends the android back key, etc.

Even if do get it to work, if I do something else and connectbot closes 
(because there's not a connection open) I have to reboot to get the keyboard to 
work.

I'm using the logitech bluetooth keyboard for "android 3.0+".  Anyone have a 
solution that works regardless of when you pair the keyboard?

Original comment by broad...@gmail.com on 2 Oct 2012 at 4:38

GoogleCodeExporter commented 8 years ago
Lack of full/correct ctrl/alt/esc support is killin' me.

Tried the "lorantkurthy" per comment 86, and while I get some controls working? 
 ctrl-u doesn't erase a line.   ctrl-w   just ends my ssh session forcefully.

So.. that's not useful at all.

Nexus7 with 4.1.2

Original comment by ak.hep...@gmail.com on 16 Oct 2012 at 10:27

GoogleCodeExporter commented 8 years ago
ConnectBot seems to be no longer actively developed or supported, based on the 
inactivity of the project log.

Other developers have taken ConnectBot, forked it and extended and improved it 
though, including the "VX ConnectBot" project which I've found does work with 
blue tooth keyboards effectively and still retains the ConnectBot look and feel.

VX ConnectBot is in the play store, here is the web page of the developer:
http://connectbot.vx.sk/

Original comment by jimb...@gmail.com on 16 Oct 2012 at 10:31