Rjaylyn / connectbot

Automatically exported from code.google.com/p/connectbot
https://www.google.com.ph/search?ie=UTF-8&client=ms-android-samsung&source=android-browser&q=goolplay+store&gws_rd=cr&ei=59nsVtusNaS1mAXXxJzwBw#aie=aig:xpd&gws_rd=cr
Apache License 2.0
1 stars 0 forks source link

Patch: add ctrl and alt-gr modifiers for bluetooth/hardware kbd #426

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hey,

on my Samsung Galaxy Tab, I operate a foldable bluetooth keyboard (CHINFAI 
Silikon Smart) as well as the Samsung-specific dockable hardware keyboard 
(ECR-K10D, attached via internal UART). 

Both are QWERTZ layout - that's the German kbd standard. I also operate a 
parallel loop-disk-based Debian on that senior-size phone. I like to do some 
programming - e.g. use the "joe" editor on the command line. The attached 
ConnectBot patch is essential for that. It summarizes my changes to ConnectBot 
(current Git). 

Notes:

* Patch is Signed-off-by sven-ola-aet-gmx-de
  I would appreciate if it finds it's way in.

* Ctrl modifier works both BT and stock Samsung Kbd.

* AltGr Keys are hardcoded German layout. The Android
  "event.getUnicodeChar(curMetaState)" result does not
  change if called with META_ALT_ON or META_ALT_RIGHT_ON
  as I would expect. Without these, no {[]}\@|~ keys for
  me. Maybe the missing alt-gr-translation has something
  to do with the Samsung-IME - I'not sure about that. Other
  IME (e.g. Swype or Gingerbread-Keyboard) do not translate
  to German layout at all (e.g. got "y" when I press "z-key").

* To get Alt-Gr as well as the "official" ctrl scancodes
  that are not avail on that Samsung Kbd, I hacked in a small
  kernel module that changes some keys. This is attached 
  as reference (both source and binary).

HTH
// Sven-Ola

Original issue reported on code.google.com by svenola....@googlemail.com on 14 Feb 2011 at 12:36

Attachments:

GoogleCodeExporter commented 8 years ago
Tests like:

+           if (keyCode == KeyEvent.KEYCODE_UNKNOWN && key == 0 && scanCode == 1)
+               key = 0x1B; // Esc

don't seem too robust. For example, with my external USB keyboard, Esc gives 
KeyEvent.KEYCODE_BACK. However, scan is the same - 1, and this appears to be 
pretty standard scancode (Linux kernel knows it the same way).

So, proper way to handle scancodes appears to be let existing ConnectBot key 
processing to try to do its job, and the very end, instead of reporting key as 
unprocessed, to check scancodes (and only scancodes) and process them. At least 
that's how I do it in my fork, 
https://sourceforge.net/p/chdistro-droid/connectbot/

Original comment by pmis...@gmail.com on 4 Sep 2011 at 9:18

GoogleCodeExporter commented 8 years ago
Have you tried the tablet branch version of connectbot yet?  it works perfectly 
for me on my qwerty bluetooth keyboard.

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

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Just dupping report regarding tablet branch from #369:

Comment 40 by pmis...@gmail.com, Sep 12, 2011

Notion Ink Adam, Android 2.2 (BeastRom), tablet branch crashes on start.

Original comment by pmis...@gmail.com on 1 Oct 2011 at 7:51