1. Check out our companion app, Forums for Android! Download from Google Play

General LGAlly-specific ConnectBot modification

Discussion in 'Android Devices' started by marcus531, Jul 23, 2010.

  1. marcus531

    marcus531 Member
    Thread Starter

    Jun 8, 2010
    Unix Sysadmin, Network Admin
    Orlando, FL
    The LG Ally is probably the best currently available smartphone for remote ssh and unix access and control ... except ...

    The LG Ally's hard-keyboard is missing the following symbols: \ | `

    and those are rather important for unix ... Granted, you can switch to the soft keyboard, switch to alt-space or symbols-key-mode or hold-down on the proper keys to get to the pipe-symbol for example, but that is grossly inefficient and error-prone and violates the entire idea of why I wanted an Ally (90% of which is so that I can run unix commands while standing in someone else's office or cube).

    Since the only real solution for sshing being connectbot and since there is no way to directly edit the keymap that I know of (is there a way to edit the main keyboard keymap?) ...

    I solved this problem crudely but effectively ...

    I downloaded the Connectbot source tree,

    modified TerminalKeyListener.java

    (found that v505 had backup stuff for android 2.2,

    stepped back to v501, did the modifications again)
    and now have a working version of Connectbot 501 that is specifically modified to remap certain keys for the LG Ally.

    My changes can be found at http://amiradance.com/lg-ally/TerminalKeyListener.java and http://amiradance.com/lg-ally/connectbot-v501-ally.apk

    I ONLY changed that one java file and recompiled successfully, intentionally to minimize changes for now.

    My UNDOCUMENTED changes are:

    1. alt+q = tab (alt-q already claims to be a tab but fails)
    2. alt+w = \ (mnemonic: w has slashes in it and)
    3. alt+e = | (E has a vertical bar in it)
    4. alt+a = ` (keeping with the theme of alt-d=" and alt-s=')
    5. alt+z = - (much more convenient than alt-y)
    6. function-keys are on alt+#s instead of shift+#s
    7. change-font is alt+vol-keys
    8. plain-vol-keys = ctrl_a n and ctrl_a p (for the unix 40-terminals-at-once program screen)

    I have sat on this program (using it myself constantly) for two weeks in which I have tried several ways to (unsuccessfully) contact the lead ConnectBot developer via his contact page at Contact Me - Kenny Root, by joining and emailing the developer's google-groups list (post rejected because I'm not a manager), and on freenode.net #connectbot and posting on the ConnectBot keyboard help page to no avail.

    Just to be clear, I'm not posting this to the Android market, I'm not selling anything, and I'm not going to fork the ConnectBot project, I'm just offering a device specific mod out of desperation because I can't legitimately ask the ConnectBot developers to make changes for every device out there, and I NEED basic unix command-line keys to do my job. I am posting this quick-mod as a public service so that others may benefit from my quick solution to my work-related needs. (Although I did this on my own freetime on my home computer and not while at work, so that I can be free to post this without that constraint.)

    I suspect there may / might be many others (especially for on-call sysadmin-types) strongly interested in the fantastic-keyboard LG Ally who have discovered that the keyboard is missing those few keys and switched over to the MotoDroid? instead with its bad-but-complete keyboard. (Try typing lots of IP addresses or movement-passwords on a MotoDroid? ... not easy, but trivial on an Ally.)

    Incidentally, I hope to add options to make my changes toggle-able, probably add alt-x/c/v as box-copy/line-copy/paste, and probably add takeover-of-hard-keyboard-search/back/home/menu-keys(not phone-face-versions of those keys though), and to have a menu-screen to map alt-shift-anything to multi-line-macros, allowing anything from passwords to mini-scripts (all of which is a lot more complicated load+save and editing-logic code, practically like adding a little notepad INSIDE ConnectBot ... even worse if I want macros to be specific per host or connection (this host needs F1 through F24, that one has lots of passwords and various quick-scripts, the other host has various IP addresses stored in ctrl-shift-#s, etc)).

    (The changes I've already done were trivially easy, but adding a menu system and the save/load code will be much less trivial than the quick stanzas that I added to TerminalKeyListener?).

    At this time, MY CHANGES TO THIS PROGRAM ARE NOT DOCUMENTED in the help screens or anywhere else other than this post and between my ears. If you are an Ally owner who wants to get better unix ssh functionality NOW while we wait for the ConnectBot developers to incorporate my changes, feel free to download the installer file that I put in Index of /lg-ally .

    Again, this is a quick-mod, not a proper alteration (where I'd have had to alter configuration screens, add global variables, and add code to multiple java files to handle editing, loading, saving those ALLY-MOD-ON type variables ... and several of those, because my volume-keys alteration really should be a separate configuration option just like the camera-key control options are.)

    IF YOU ARE A PROFESSIONAL SYSADMIN, to be properly responsible, you should download my modified java file, compare to the original, download the entire android SDK, download the windows version of a SubVersion checkout system, use that to check-out+download v501 of the ConnectBot source, swap in my file after checking that I did not insert a keylogger into the keyboard code and recompile then install your own newly created installer. My changes are ALL marked with lines like
    // start MAW change
    // end MAW change
    so it should be relatively obvious what (and how little) I changed.

    If anyone has any other Ally-specific mods (or ideas), I will gladly incorporate those (or post a recompilation just for you) ... If anyone would like to to similarly mod ConnectBot for your own non-Ally platform, I will gladly explain and walk you through what I've done (and my changes are REALLY easily visible) ... but I have no intention of maintaining a truly separate branch of Connectbot or taking any of the accolades or praise from the REAL ConnectBot developers, who wrote a far larger, better, and more thoroughly documented program than I have ever done (yet). I have merely made a small tweak, they deserve all credit for this fantastic program.



    vortmax likes this.
  2. Qasar

    Qasar Member

    Jul 24, 2010
    Brooklyn, NY
    \ and | can be found on the Ally QWERTY by pressing [Alt] + [Space Bar]


    PS- posted this in that other forum. Not stalking you, just thought others here might find this helpful here too.
  3. marcus531

    marcus531 Member
    Thread Starter

    Jun 8, 2010
    Unix Sysadmin, Network Admin
    Orlando, FL
    I'm quite aware of the normal way to do this, but connectbot is a special failure-case ... that key-combo doesn't work within connectbot ... much to my annoyance

    Try this:
    download connectbot
    log in to any unix or linux server
    hit alt-space
    in FreeBSD, in the bash shell, alt-space shows up as \356\274\201
    in FreeBSD, in vi, alt-space shows up as \xee\xbc\x81

    Under linux (Fedora 11), either way, it shows up as an i-can't-print-this-character box, just like when I try to display arabic or japanese characters in a translator on my Ally that does not have those character sets.
  4. vortmax

    vortmax Member

    Nov 26, 2010
    I've been using this version for a while now and it amazing. So thanks for your hard work.

    I would like to make two changes though. I would like to return the function keys to shift...I have to think too much while typing fast to remember that alt+letter is a symbol but alt+number isn't. I found the section in the code where the f keys were switched. I'm assuming there is another section swapping the symbols?

    Also, is it possible to remap the search button (just above the alt key) to tab, or is that key not remappable?
  5. rec9140

    rec9140 Member

    Dec 1, 2010
    Sworn & Armed Geek
    Land of Android & Linux!
    Very interesting... THANKS.. I am looking at SSH clients right now so I can SSH into my servers and do things...

    OK... I'll bite... A "professional sysadmin....windows subversion..." :eek:

    Nope... real sysadmins don't do windows. :p :D :)

Share This Page