Isaac-Cha / 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
The bluetooth stack is also available in opendesire and defrost firmwares.

Original comment by sophan...@gmail.com on 27 Sep 2010 at 4:52

GoogleCodeExporter commented 8 years ago
The same is also valid for USB keyboards and all types of hardware keyboards.
I think this may be a problem that stems from the Android base system, as the 
situation is the same for any other Android app at the moment - I don't think 
the buttons are exposed via the API.

Original comment by rah...@gmail.com on 9 Dec 2010 at 9:20

GoogleCodeExporter commented 8 years ago
I'm seeing the same problem here with a Freedom Pro keyboard connected via 
Bluetooth to a Galaxy Tab.  

This problem with hardware keyboards is really limiting.  With working hardware 
keyboard support, ConnectBot on a Galaxy Tab would make an excellent remote 
login solution.

Original comment by tmb...@gmail.com on 3 Feb 2011 at 4:25

GoogleCodeExporter commented 8 years ago
This problem appears to be due to mappings within Android.  The Escape key 
seems to map to the 'back' button.  Ctrl keys simply send the non-ctrl 
character.

It'd be great if ConnectBot could work around this, but I'm sceptical if it's 
possible to work around at the layer ConnectBot operates.

Original comment by linuxk...@gmail.com on 12 Apr 2011 at 12:44

GoogleCodeExporter commented 8 years ago
You can't work around it perfectly, but you can make it quite a bit 
better by making the system "teachable".  For individual keys, like 
Escape, do something like:

Configure "Escape" key > Please hit the key you would like to map to 
"Escape" on your keyboard.

For modifier keys, you may need to try to infer the modifier key from 
multiple key presses:

Configure "Ctrl" key > Please hit "Ctrl-A" on your keyboard, using the 
modifier key that you would like to map to "Ctrl". > Please hit "Ctrl-B" 
on your keyboard.

And you might have the option of mapping "Ctrl" to a prefix (the keys 
aren't hit simultaneously, but one after the other):

Configure "Ctrl" key as a prefix. > Please hit the key on your keyboard 
that you would like to map to a "Ctrl" prefix.

Finally, you may be able to use arbitrary keys as "Ctrl" keys by 
detecting chording (X-down, Y-down, X/Y-up); I believe Bluetooth HID 
supports that and I would guess the Android keyboard driver should pass 
that on as well.

That way, whatever is possible with a keyboard and phone can be done.  
Also, I can remap printable characters (e.g., weird national characters) 
to act as "Escape" or a "Ctrl" prefix.

Tom

Original comment by tmb...@gmail.com on 12 Apr 2011 at 4:18

GoogleCodeExporter commented 8 years ago
This would be a very useful feature.  I have Freedom Pro keyboard, and Ctrl, 
Tab, Alt, Esc do not work with connectbot.  I bought the keyboard so it would 
be easier to code in emacs over connectbot, but without special keys it is not 
very useful

Original comment by matt.foj...@gmail.com on 13 Apr 2011 at 2:57

GoogleCodeExporter commented 8 years ago
Comment #5 is RIGHT-ON.  EXACTLY what I've been asking for!  I made the point 
that this is similar to how some emulators work, mapping keys to keypresses in 
the key binding menu (ala the *oid emulators by "yongzh").

Original comment by Mi1e...@gmail.com on 14 Apr 2011 at 3:23

GoogleCodeExporter commented 8 years ago
Tab key works OK when I edit memo on my Galaxy S. In ConnectBot I need to touch 
the screen, then tap CTRL then press "i" on my external BT keyboard. Can this 
be fixed?

Original comment by are...@gmail.com on 19 Apr 2011 at 4:57

GoogleCodeExporter commented 8 years ago
I have similar problems with connectbot when using my Motorola Xoom and a 
Motorola Bluetooth keyboard. Tab doesn't work in Connectbot but it works fine 
in other applications. Arrow keys seem to work most of the time, but none of 
the control key sequences work at all.

Batteries on keyboard are still fresh and Xoom charged over 80%.

Original comment by kbcm...@gmail.com on 8 May 2011 at 9:47

GoogleCodeExporter commented 8 years ago
Same symotoms on my Samsung Galaxy Tab hardware keyboard dock.

Original comment by Mi1e...@gmail.com on 9 May 2011 at 12:57

GoogleCodeExporter commented 8 years ago
Same issue on ASUS transformer when using hardware keyboard dock.

Original comment by ktwomb...@gmail.com on 9 May 2011 at 5:59

GoogleCodeExporter commented 8 years ago
Wouldn't it be really handy if ConnectBot same with a menu option to print 
keyboard scancodes so that you can see what the heck your keys map out to so 
that we can tell the author what our different keyboards are showing up for 
things like CTRL or the mysterious blank key (like on my Samsung Galaxy Tab 
keyboard dock, under the ENTER key)?  :P   Would be a nice debugging tool and 
helpful way for users to give back some info on their varying hardware.

Just saying.

Original comment by Mi1e...@gmail.com on 10 May 2011 at 9:50

GoogleCodeExporter commented 8 years ago
When I try to use the * (works fine in the browser as you can see) but in 
ConnectBot, what it displays is ~9 on my Linux box. If I knew what I could do 
to help, I would be happy to look up key codes for you or whatever, but I'd 
need a little how-to that would help me give you what you're looking for. 
Better yet, if you provided an application that gave me the list of keys to 
hit, I could press each of them for you and send you the output from the 
program. One way or the other, please help me help make CB better. :-) It's 
been my favorite ssh program since my first Android phone. :-)

KB

Original comment by kbcm...@gmail.com on 28 May 2011 at 9:39

GoogleCodeExporter commented 8 years ago
it's open source, seems that doing it yourself is the option. Look, this case 
hangs since Sep 2010 and does not even have an owner.

Original comment by are...@gmail.com on 1 Jun 2011 at 4:16

GoogleCodeExporter commented 8 years ago
Not everyone is a developer and can fix this for themselves.  As well, fixing 
it for yourself doesn't make it available as a new version in the market for 
everyone else.  Suggestions for the rest of us?

Original comment by Mi1e...@gmail.com on 1 Jun 2011 at 4:59

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
there are already some partial fixes posted:
http://code.google.com/p/connectbot/issues/detail?id=378

Seems that nobody from connectbot has included them.
Is connectbot a dead project?

Original comment by sophan...@gmail.com on 4 Jun 2011 at 9:41

GoogleCodeExporter commented 8 years ago
I have observed the same issue on xoom using bluetooth keyboard. no tab or ctrl 
functionality. 

Original comment by stratumo...@gmail.com on 9 Jun 2011 at 11:21

GoogleCodeExporter commented 8 years ago
Same issue with Motorola Atrix

Original comment by ondre...@gmail.com on 29 Jun 2011 at 7:15

GoogleCodeExporter commented 8 years ago
I've opened pull request #16 on github 
(https://github.com/kruton/connectbot/pull/16) -- works great with my logitech 
bluetooth keyboard

Original comment by pfngu...@gmail.com on 30 Jun 2011 at 9:45

GoogleCodeExporter commented 8 years ago
I installed the latest development build a few minutes ago. I can see that the 
built-in shortcuts work now, such as ctrl+c for copy, ctrl+u for URL search, 
but connectbot still doesn't seem to be *sending* ctrl or alt to the remote 
server when pressed. :(

Original comment by ktwomb...@gmail.com on 2 Jul 2011 at 2:18

GoogleCodeExporter commented 8 years ago
I take that back, sorta. I undocked my transformer and redocked it, and now the 
meta keys seem to be working like a charm. 

Original comment by ktwomb...@gmail.com on 2 Jul 2011 at 2:37

GoogleCodeExporter commented 8 years ago
I just tried the latest featured (4.26.38) version with my BT keyboard. I just 
connected to my linux box and press some keys :-) The results is:

- The Alt button start working. Hurrah! Although it is not "sticky", but this 
is the begin :-)

Unfortunately, this is only good thing. All other is bad :-(

- The "Ctrl" key still don't work at all
- The "Home" key works like home button and the "End" key works like power 
button. This is small problem, but Esc key works as "back button" ant this is 
much worse for any *nix system :-(

Please, don't stop! The connectbot is the best ssh client for Androis OS and we 
all waiting for resolving this issue :-)

Original comment by 3575...@gmail.com on 2 Jul 2011 at 12:38

GoogleCodeExporter commented 8 years ago
Sounds like your keyboard doesn't send the correct key code for ctrl esc home 
or end.

Alt shouldn't be sticky on an external keyboard. 

Original comment by pfngu...@gmail.com on 2 Jul 2011 at 5:03

GoogleCodeExporter commented 8 years ago
I don't know. I use some "standard" unnamed BT keyboard. This model works fine 
with WM, Symbian and iPhone. So I think this must be some program error. I 
repeat - this is _BlueTooth_ keyboard, not just "external". I'm sure this is 
important.

P.S. Apropos, The Cntrl key on BT keyboard works just fine in "Better Terminal 
Emulator Pro" SSH Client. Unfortunately I can't use this client because of some 
another problems with it ;-)

Original comment by 3575...@gmail.com on 2 Jul 2011 at 5:19

GoogleCodeExporter commented 8 years ago
I dunno about your keyboard, but it works fine with my bluetooth logitech 
keyboard which sends all the standard scancodes.

Are you on honeycomb?  No idea how it would work prior to 3.0

Original comment by pfngu...@gmail.com on 3 Jul 2011 at 5:49

GoogleCodeExporter commented 8 years ago
I use Gingerbread (2.3.3)

Original comment by 3575...@gmail.com on 3 Jul 2011 at 6:09

GoogleCodeExporter commented 8 years ago
Yeah, that explains that

Original comment by pfngu...@gmail.com on 3 Jul 2011 at 5:47

GoogleCodeExporter commented 8 years ago
So, right now we have the solution for tablets, but still do not have solution 
for smartphones :'-( 

Original comment by 3575...@gmail.com on 3 Jul 2011 at 7:32

GoogleCodeExporter commented 8 years ago
actually, after installing latest development version (2011-07-01) the TAB key 
started working, the rest of the keys (CTRL, ALT, ESC) still not working

Original comment by are...@gmail.com on 4 Jul 2011 at 12:53

GoogleCodeExporter commented 8 years ago
working on the ASUS transformer. NOW it's become a serious productivity 
machine. Where should my donation go?

Original comment by apbar...@gmail.com on 5 Jul 2011 at 4:45

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
For Asus Transformer support see Issue 459.

Original comment by silvia.l...@gmail.com on 11 Jul 2011 at 8:08

GoogleCodeExporter commented 8 years ago
Using plain USB keyboard on an Acer Iconia Tab A500, similar problems. 
Ctrl+anything always inserts ^@, and shift+numbers inserts random control codes 
instead of correct symobols like !@#$%^&*(). Makes it nearly impossible to 
perform tasks on linux servers :'(

Original comment by dro...@gmail.com on 9 Sep 2011 at 10:11

GoogleCodeExporter commented 8 years ago
https://code.google.com/p/connectbot/issues/detail?id=426#c1

Original comment by nyamny...@gmail.com on 9 Sep 2011 at 11:17

GoogleCodeExporter commented 8 years ago
Have you guys tried the tablet branch version yet?  Works perfectly fine with 
my bluetooth keyboard. (honeycomb and newer only).

Original comment by pfngu...@gmail.com on 11 Sep 2011 at 11:47

GoogleCodeExporter commented 8 years ago
On my samsung galaxy S2 tablet branch crashes after connect and just after 
screen turning. Master version still don't work with ctrl.

Original comment by 3575...@gmail.com on 12 Sep 2011 at 8:53

GoogleCodeExporter commented 8 years ago
Tablet branch isn't ready for phones yet, I think

Original comment by pfngu...@gmail.com on 12 Sep 2011 at 3:29

GoogleCodeExporter commented 8 years ago
Notion Ink Adam, Android 2.2 (BeastRom), tablet branch crashes on start.

Original comment by pmis...@gmail.com on 12 Sep 2011 at 6:15

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Tablet branch is a no-go on Samsung Galaxy Tab running Android 2.2, nor 
Motorola Droid A855 running Android 2.3.4, sooooo..... no.  Haven't tried it.  
:)

Original comment by Mi1e...@gmail.com on 12 Sep 2011 at 6:22

GoogleCodeExporter commented 8 years ago
I think there's a fairly simple patch for this. In short, I added a 
hardkeyboard check using is(Alt|Shift|Ctrl)Pressed() to update curMetaState. 

It seems to work on my Xoom using a bluetooth keyboard. I also tested the 
virtual keyboard and that seemed to stay the same.

Feel free to review, optimize and test since the beer tends to make me miss 
stuff.

Original comment by jrcon...@gmail.com on 25 Sep 2011 at 4:49

Attachments:

GoogleCodeExporter commented 8 years ago
If that's all we need... OH.. MY.. GOD!  You are THE MAN!  :)  I eagerly await 
a new update/release in the Android market to try this out on my various 
Android-based devices.  I DESPERATELY need this functionality in order to do 
any kind of real work.  THANK YOU!  :)

Original comment by Mi1e...@gmail.com on 25 Sep 2011 at 9:39

GoogleCodeExporter commented 8 years ago
@jrcon... the tablet branch already has support for bluetooth/external 
keyboards.

Additionally, your patches only work on honeycomb or newer anyway.  Can't go 
into the master branch as-is.

Original comment by pfngu...@gmail.com on 26 Sep 2011 at 11:32

GoogleCodeExporter commented 8 years ago
@pfngu

I tried a Tablet SVN build and it didn't support ctrl and meta on my USB 
keyboard. Is the tablet branch supposed to do this?

Original comment by 100Dash...@gmail.com on 1 Oct 2011 at 3:59

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.

Original comment by lkokli...@gmail.com on 1 Oct 2011 at 7:24

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.

Cool, thanks for confirming! It works by using keyboard scancodes, which is 
industry standard (even if maybe de facto). Just need to collect more evidence 
to convince the maintainer, following first attempt (with not too clean code, 
yeah) at https://github.com/kruton/connectbot/pull/3

Just in case, my changes can be reviewed here: 
https://sourceforge.net/p/chdistro-droid/connectbot/ci/ext-keyboard/log/

Original comment by pmis...@gmail.com on 1 Oct 2011 at 8:05

GoogleCodeExporter commented 8 years ago
>Cool, thanks for confirming! It works by using keyboard scancodes, which is 
industry >standard (even if maybe de facto). Just need to collect more evidence 
to convince the >maintainer, following first attempt (with not too clean code, 
yeah) at >https://github.com/kruton/connectbot/pull/3

>Just in case, my changes can be reviewed here: 
https://sourceforge.net/p/chdistro->droid/connectbot/ci/ext-keyboard/log/

I tried this version on my Thinkpad Tablet with three USB keyboards, and I 
didn't have any luck. I used the Thinkpad folio case, a wireless mini keyboard 
(Rii Mini), and a standard USB desktop keyboard.

Original comment by 100Dash...@gmail.com on 2 Oct 2011 at 5:26

GoogleCodeExporter commented 8 years ago
(Feel like this bug becomes semi-offtopic forum, but it actually did long time 
ago, so just continuing.)

How did you test it, what output did you get and what you expected? Besides 
that, your next step is using tool like 
http://github.com/chrisboyle/keytest/downloads to carefully write down its 
output for each of "problematic" keys like Esc, both Ctrl's, etc.

Original comment by pmis...@gmail.com on 2 Oct 2011 at 6:21