[APP] ConnectBot v1.7.1-epic-6 (Epic keyboard support) (6/29/11)

Search This thread

mkasick

Retired Recognized Developer
Aug 10, 2009
470
830
6/29/11 Update: Add keycodes for EF02's ":)" and "Sym". Thanks EvilDennisR for providing the new keycodes, eyecannon for confirmation.

5/5/11 Update: Fix handling of ENTER key in fix_dead patch, i.e., make non-printable and emit carriage return. Thanks xbj9000 & Fnorder for pointing out this bug.

1/13/11 Update: Add key_logic patch from git to make ConnectBot use the correct hardware keymap, eliminating the need for the previous '_' & '-' swap workaround. Add fix_dead patch to fully implement combining accent (dead key) support. See note about combining accents on the Epic below.

12/20/10 Update: Add keep local connection patch. Add Tab, Home, End, Page Up/Down keys. Add partial support for Swype's edit keyboard.

12/1/10 Update: Fix use of arrow keys for moving the selection cursor when copying text.

Attached is a build of ConnectBot v1.7.1 modified to better support the Epic's keyboard. Also attached are the source patches against the v1.7.1 sources.

Changes are:
  • Make ":)" an alternate dpad-center (one press emits Ctrl, two presses emit Esc).
  • Make "Sym" emit Tab.
  • Make ".com" (Fn+"Sym") emit '`' (backtick, the only missing printable ASCII character).
  • Make arrow keys able to move the copy selection cursor.
  • Make ":)" and Enter (to support Swype's edit keyboard) select the copy region.
  • Make Fn+Left emit Home, Fn+Right emit End, Fn+Up emit Page Up, and Fn+Down emit Page Down.
  • Enable Tab key in Swype & other virutal keyboards.
  • Enable Home, End, & Cursor Jump in Swype's edit keyboard. Cursor Jump makes the arrows emit Home, End, Page Up/Down.
  • Workaround to make Fn+W emit '-' (hyphen/minus) and Fn+E emit '_' (underscore).
  • Make ConnectBot use the correct hardware keymap for the Epic, fixes the swapping of '-' & '_' and other subtle keymap bugs.

Although the hardware-keyboard changes are specific to supporting the Epic, this build should run fine on other devices--I don't think the keymaps conflict.

About the workaround: in regular ConnectBot v1.7.1, Fn+W emits '_' (underscore) while Fn+E emits '-' (hyphen/minus), which is backwards compared to other applications. I'm not sure why this is, as the key character map appears to be correct from what I can tell. This bug is due to ConnectBot's previous method of decoding key characters where it assumes the hardware keymap is the first one specified in the Android properties database (hw.keyboards.0.devname), which it is not on the Epic. A fixed method of decoding key characters was comitted to ConnectBot's github repo last month in a patch that also partially (brokenly) implements support for combining accents. I've added this patch and another to this release to fix both the swap bug and fully implement support for combining accents.

Note on combining accents: The standard Epic keymap does not include support for combining accents (dead keys). I've posted a modified keymap to add these. See the thread for details.

I've also added a patch to reenable the use of arrow keys (on both hardware and virtual keyboards) to move the selection cursor when copying text. You may use either ":)" (hardware keyboard) or Enter (both hardware & Swype's edit) to select where the start and end the copy region.

Unfortunately Swype's Select All, Select Text, Cut, Copy, and Paste keys do nothing in ConnectBot as they do not emit keycodes, but copy & paste support is availble via the menu, arrow, and Enter keys. Also, Swype's Page Up/Down keys simply generate 5xUp/Down arrows. Cursor Jump+Up/Down may be used a real Page Up/Down instead.

Enjoy!

Mirror links (does not require forum login):
connectbot-1.7.1-epic-6.apk
connectbot_create_outdir.diff
connectbot_fix_copy.diff
connectbot_keep_local.diff
connectbot_key_logic.diff
connectbot_fix_dead.diff
connectbot_epic_keymap.diff
connectbot_swype_keymap.diff
 

Attachments

  • connectbot-1.7.1-epic-6.apk
    767 KB · Views: 411
  • connectbot_create_outdir.diff.txt
    433 bytes · Views: 35
  • connectbot_fix_copy.diff.txt
    3.2 KB · Views: 26
  • connectbot_keep_local.diff.txt
    1.4 KB · Views: 18
  • connectbot_key_logic.diff.txt
    4 KB · Views: 18
  • connectbot_fix_dead.diff.txt
    4.6 KB · Views: 16
  • connectbot_epic_keymap.diff.txt
    1.1 KB · Views: 18
  • connectbot_swype_keymap.diff.txt
    4.6 KB · Views: 21
Last edited:

shabbypenguin

Inactive Recognized Developer
May 30, 2010
4,895
5,361
36
very nice, thanks much for this.

5 bucks someone makes a comment about how this is in dev and not in the themes and apps board tho
 

yehster

New member
Oct 18, 2010
2
0
Thanks

Wrong forum or not, this is perfect, I was going to change my system keylayout to accomplish this before, but this is a much better solution.
 

cicada

Senior Member
Nov 7, 2009
173
153
Denver, CO
Amazing, thanks for this! ConnectBot was near-perfect for my needs, you just pushed it over the finish line :)
 

drunix

Senior Member
Sep 15, 2010
85
6
Haven't tried it yet, but I was just about ready to do keymappings identical to yours at the android layer... I like your solution a lot better, though, thank you!
 

JungleJiujitsu

Senior Member
Sep 12, 2010
1,156
87
Westbury, NY
Sorry, but im just about a month into the "rooting scene" and am not yet familiar with what this is, can someone please explain?

Sent from my SPH-D700 using XDA App
 

mkasick

Retired Recognized Developer
Aug 10, 2009
470
830
Sorry, but im just about a month into the "rooting scene" and am not yet familiar with what this is, can someone please explain?
ConnectBot is an open-source terminal emulator and SSH client for Android. If you're a Windows user, think of it as a combination of the "Command Prompt" and PuTTY programs, but for your phone.

The Epic is an important device for ConnectBot users as it's one of the few programs that really requires (or at least benefits from) a hardware keyboard. Unfortunately, the Epic keyboard, while very good compared to the Droid (and I'd argue the G2 also) is missing a few keys important for ConnectBot, but has other extra keys that are unused. So this is a modified version of the program to better support the Epic's keyboard, making ConnectBot much more convenient to use.

In general ConnectBot is not a particularly important program for "rooting" (although root makes it vastly more useful locally). As suggested earler, this thread should really belong in the Themes & Apps forum.

That said, I imagine ConnectBot is a somewhat popular program among Epic owners as its (near) requirement of a hardware keyboard makes the Epic a much more suitable device to use with it than the Evo, and so those folks interested in using it are more likely to purchase an Epic.
 
  • Like
Reactions: insanity213

mkasick

Retired Recognized Developer
Aug 10, 2009
470
830
So is it like what someone posted a few weeks back on how they changed the smiley face key to place an @ symbol instead, but only now with this app I can change it to whatever I want?... TIA
shabbypenguin is incorrect. ConnectBot has nothing to do with altering keyboard mapping for the entire system. I just posted a modified version of ConnectBot that has altered keybindings internally.

As a terminal emulator, it is unusual compared to most Android applications in that much of the hardware keyboard support is implemented internally (from the keycode level up) instead of using standard input widgets.

Sorry for the confusion.
 

Forcystos

Senior Member
Mar 4, 2010
117
12
Awesome work. Is there a Ctrl shortcut on the regular build? I got stuck the other day because I couldn't Ctrl+C out of an app.

Sent from my SPH-D700
 

DRockstar

Retired Recognized Developer
Sep 30, 2010
309
561
Pasadena, CA
I'm curious... does this version still disconnect in local mode when a call comes in? I like Connectbot, but being disconnected while editing my script locally with vi editor, was something that irritates me with the version I tried from the Market.

After researching the bug, the only fix I saw was a different source tree with a fix included.

If this fix is included, it would finally replace the Android Terminal for me.

Thanks for working on this for the Epic, by the way!

Sent from my SPH-D700 using Tapatalk
 

mkasick

Retired Recognized Developer
Aug 10, 2009
470
830
I'm curious... does this version still disconnect in local mode when a call comes in?
The update I just posted fixes this now. Somehow I never managed to run into this, but I was able to reproduce the problem and it's pretty annoying. Thanks for pointing out the patch.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 5
    6/29/11 Update: Add keycodes for EF02's ":)" and "Sym". Thanks EvilDennisR for providing the new keycodes, eyecannon for confirmation.

    5/5/11 Update: Fix handling of ENTER key in fix_dead patch, i.e., make non-printable and emit carriage return. Thanks xbj9000 & Fnorder for pointing out this bug.

    1/13/11 Update: Add key_logic patch from git to make ConnectBot use the correct hardware keymap, eliminating the need for the previous '_' & '-' swap workaround. Add fix_dead patch to fully implement combining accent (dead key) support. See note about combining accents on the Epic below.

    12/20/10 Update: Add keep local connection patch. Add Tab, Home, End, Page Up/Down keys. Add partial support for Swype's edit keyboard.

    12/1/10 Update: Fix use of arrow keys for moving the selection cursor when copying text.

    Attached is a build of ConnectBot v1.7.1 modified to better support the Epic's keyboard. Also attached are the source patches against the v1.7.1 sources.

    Changes are:
    • Make ":)" an alternate dpad-center (one press emits Ctrl, two presses emit Esc).
    • Make "Sym" emit Tab.
    • Make ".com" (Fn+"Sym") emit '`' (backtick, the only missing printable ASCII character).
    • Make arrow keys able to move the copy selection cursor.
    • Make ":)" and Enter (to support Swype's edit keyboard) select the copy region.
    • Make Fn+Left emit Home, Fn+Right emit End, Fn+Up emit Page Up, and Fn+Down emit Page Down.
    • Enable Tab key in Swype & other virutal keyboards.
    • Enable Home, End, & Cursor Jump in Swype's edit keyboard. Cursor Jump makes the arrows emit Home, End, Page Up/Down.
    • Workaround to make Fn+W emit '-' (hyphen/minus) and Fn+E emit '_' (underscore).
    • Make ConnectBot use the correct hardware keymap for the Epic, fixes the swapping of '-' & '_' and other subtle keymap bugs.

    Although the hardware-keyboard changes are specific to supporting the Epic, this build should run fine on other devices--I don't think the keymaps conflict.

    About the workaround: in regular ConnectBot v1.7.1, Fn+W emits '_' (underscore) while Fn+E emits '-' (hyphen/minus), which is backwards compared to other applications. I'm not sure why this is, as the key character map appears to be correct from what I can tell. This bug is due to ConnectBot's previous method of decoding key characters where it assumes the hardware keymap is the first one specified in the Android properties database (hw.keyboards.0.devname), which it is not on the Epic. A fixed method of decoding key characters was comitted to ConnectBot's github repo last month in a patch that also partially (brokenly) implements support for combining accents. I've added this patch and another to this release to fix both the swap bug and fully implement support for combining accents.

    Note on combining accents: The standard Epic keymap does not include support for combining accents (dead keys). I've posted a modified keymap to add these. See the thread for details.

    I've also added a patch to reenable the use of arrow keys (on both hardware and virtual keyboards) to move the selection cursor when copying text. You may use either ":)" (hardware keyboard) or Enter (both hardware & Swype's edit) to select where the start and end the copy region.

    Unfortunately Swype's Select All, Select Text, Cut, Copy, and Paste keys do nothing in ConnectBot as they do not emit keycodes, but copy & paste support is availble via the menu, arrow, and Enter keys. Also, Swype's Page Up/Down keys simply generate 5xUp/Down arrows. Cursor Jump+Up/Down may be used a real Page Up/Down instead.

    Enjoy!

    Mirror links (does not require forum login):
    connectbot-1.7.1-epic-6.apk
    connectbot_create_outdir.diff
    connectbot_fix_copy.diff
    connectbot_keep_local.diff
    connectbot_key_logic.diff
    connectbot_fix_dead.diff
    connectbot_epic_keymap.diff
    connectbot_swype_keymap.diff
    2
    Can anything be done?
    Unlike past TW versions, CyanogenMod doesn't use unique/unused keycode assignments for ":)" and "Sym", so patching ConnectBot itself breaks the generation of @ by software keyboards (e.g., Hacker's Keyboard).

    My recommendation is to install a custom key layout. The attached "s3c-keypad.kl.txt", if copied as "/system/usr/keylayout/s3c-keypad.kl", reassigns ":)" to DPAD_CENTER (Ctrl/Esc) and "Sym" to BUTTON_C (Tab/'`'), and works with existing builds of Epic ConnectBot.
    1
    Sorry, but im just about a month into the "rooting scene" and am not yet familiar with what this is, can someone please explain?
    ConnectBot is an open-source terminal emulator and SSH client for Android. If you're a Windows user, think of it as a combination of the "Command Prompt" and PuTTY programs, but for your phone.

    The Epic is an important device for ConnectBot users as it's one of the few programs that really requires (or at least benefits from) a hardware keyboard. Unfortunately, the Epic keyboard, while very good compared to the Droid (and I'd argue the G2 also) is missing a few keys important for ConnectBot, but has other extra keys that are unused. So this is a modified version of the program to better support the Epic's keyboard, making ConnectBot much more convenient to use.

    In general ConnectBot is not a particularly important program for "rooting" (although root makes it vastly more useful locally). As suggested earler, this thread should really belong in the Themes & Apps forum.

    That said, I imagine ConnectBot is a somewhat popular program among Epic owners as its (near) requirement of a hardware keyboard makes the Epic a much more suitable device to use with it than the Evo, and so those folks interested in using it are more likely to purchase an Epic.
    1
    Thanks so much for this very helpful connectbot mod.. I'd like to make a request though:

    Unlike some other crappy android terminals, connectbot sends a line-feed signal instead of (or in addition to?) a normal carriage-return.. Can you please patch this? Or maybe even make it an option in the menus? ..the line-feed makes it impossible to use many console linux apps..

    Thanks!

    That pissed me off to no end. I'm not sure if it's epic-specific or something with the connectbot version, however here's a patch that fixes it. Note, it requires all the previous patches.
    1
    Unlike some other crappy android terminals, connectbot sends a line-feed signal instead of (or in addition to?) a normal carriage-return..
    That pissed me off to no end. I'm not sure if it's epic-specific or something with the connectbot version, however here's a patch that fixes it.
    Sorry about that. It's a bug in the key_logic patch pulled from git. I've updated the OP with a new version that fixes this.

    I never noticed it as apparently everything I use tolerates the use of new line instead. It also breaks the use of Enter for copy (& paste). Thanks for pointing it out.

    I'm seriously tempted to scrap all the pref related stuff in TerminalKeyListener.java and replace it with a more versatile key pref system that lets one map anything to anything.
    Ideally that's what should be done. It's more of an undertaking than I'm willing to spend at the moment. Particularly unfortunate is that upstream activity has slowed significantly, so any patch may have to be maintained separately for a while.