About
Using this program you can inject keys to your phone which are pressed on your computer. Believe me, it is more convenient to type an SMS on a computer's keyboard. Of course, all the special characters (even Control-C) and Hungarian keys are working :)
Requirements
-
Android phone, obviously (tested on HTC G1, Magic and Hero)
-
Rooted firmware with uinput support: this is mandatory, becuse the program uses uinput driver to inject keys. At least one of the following files have to exist:
- /dev/uinput
- /dev/inputs/uinput
- /dev/misc/uinput
(since libraries of bluetooth headsets and keyboards use uinput, this is quite popular nowadays, this shouldn't be a problem). A rooted firmware is also necessary, otherwise RemoteInput doesn't have the right to communicate with the device. Tested on Cyanogenmod 4.2.12.
-
Connection (both methods can work over wifi or USB):
- adb: should work on linux, on Windows cmd.exe is not a real terminal, so you should connect over ssh
- over ssh: install debian or dropbear on the phone. Google will help to do that.
Installation on Android
Download RemoteInput.zip. You might have to remount /system in read-write mode. Place
-
RemoteInput.kcm.bin to /system/usr/keychars/
-
RemoteInput.kl to /system/usr/keylayout/
-
RemoteInput to /system/bin/
-
Run RemoteInput from the computer using "adb shell" (it has problems under Windows, because cmd.exe is not a real terminal) or ssh.
Installation on Android in a chrooted debian environment
Download RemoteInput.zip. You might remount /system in read-write mode. Place
-
RemoteInput.kcm.bin to the original system's /system/usr/keychars/
-
RemoteInput.kl to /the original system's system/usr/keylayout/
-
Create /andriod inside the debian environment. Before chooting, run "mount -o bind /dev $mnt/android/dev", where mnt=/data/local/mnt is from Jay Freeman's tutorial.
-
RemoteInput_debian (same as RemoteInput, but RemoteInput is compiled with static option) to anywhere and start ssh server in the chrooted debian.
-
Connect to the phone using ssh, and run RemoteInput.
Compile
If you want to modify something, this part is for you.
Both binaries are compiled on the phone using debian. The packages libncursesw5 and libncursesw5-dev are necessary.
g++ RemoteInput.c suinput.c -lncursesw -o RemoteInput
g++ -static RemoteInput.c suinput.c -lncursesw -ldl -o RemoteInput
Howto modify RemoteInput.kcm.bin
RemoteInput.kcm.bin is generated from RemoteInput.kcm with kcm.cpp. The file kcm.cpp requires KeycodeLabels.h and ByteOrder.h. All these files are from the Android source tree.
Problems
Error opening terminal: unknown. You should put the file "unknown" to /system/etc/terminfo/u/, and try again.
In linux using adb the keys from F1 to F5 don't work. You should put the file xterm to /system/etc/terminfo/x/, and type "export TERM=xterm" before start. It is far from perfect, but it works.
In Putty the function keys are not working. Then in the settings change Terminal, Keyboard, "The Function keys and keypad" to Xterm R6. I can't manage to get Del and Home work in Putty.
SMS mode
In SMS mode the following replacements are made in order to avoid annoying Unicode SMS (where you have at most 70 characters). In this version this is only for Hungarian characters. If you have any requests do not hesitate to write me.
- a with acute -> a with ring above
- A with acute -> a with ring above
- i with acute -> i with grave
- I with acute -> i with grave
- o with acute -> o with grave
- O with acute -> o with grave
- (Hungarumlaut) o with double acute -> o with diaeresis
- (Hungarumlaut) O with double acute -> O with diaeresis
- u with acute -> u with grave
- U with acute -> u with grave
- (Hungarumlaut) u with double acute-> u with diaeresis
- (Hungarumlaut) U with double acute-> U with diaeresis
Thanks:
- Brad Fitzpatrick for the idea.
- Tuomas Räsänen for the Simple C-API to the Linux uinput-system
- my brother, Gábor, for helping with keyboard keys and my brother-in-law, Zoltán Papp for compiling
If you have any question, feel free to write: