[Galaxy S 4 Developer Discussion [Developers-Only]] broodplank1337:
I always get kinda annoyed when I have to write a lot of text on my phone, the psychical keyboard of a pc is much better of course. so I decided to make script that converts your key presses to direct input on your phone. it uses an adb line for each character you type, so you may imagine it will get spammed when you type to fast. Also not all keys are defined, I did:

-- A-Z

-- 0-9

-- "space", "backspace" and "enter"

Not even finished 50% but just sharing this snippit

KeyEventDemo.java

(this is a native java app (.jar))

/*
* Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* - Neither the name of Oracle or the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

// Created by broodplank

package main;

/*
* KeyEventDemo
*/

import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.event.*;
import java.io.Console;
import java.io.IOException;

import javax.swing.*;

public class KeyEventDemo extends JFrame
implements KeyListener,
ActionListener
{

JTextArea displayArea;
JTextField typingArea;
static final String newline = System.getProperty("line.separator");

public static void main(String[] args) {
/* Use an appropriate Look and Feel */
try {

UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
} catch (UnsupportedLookAndFeelException ex) {
ex.printStackTrace();
} catch (IllegalAccessException ex) {
ex.printStackTrace();
} catch (InstantiationException ex) {
ex.printStackTrace();
} catch (ClassNotFoundException ex) {
ex.printStackTrace();
}
UIManager.put("swing.boldMetal", Boolean.FALSE);
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}
});
}

/**
* Create the GUI and show it. For thread safety,
* this method should be invoked from the
* event-dispatching thread.
*/
private static void createAndShowGUI() {
//Create and set up the window.
KeyEventDemo frame = new KeyEventDemo("CapKeyToAndroid");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

//Set up the content pane.
frame.addComponentsToPane();

//Display the window.
frame.pack();
frame.setVisible(true);
}

private void addComponentsToPane() {

JButton button = new JButton("Clear");
button.addActionListener(this);

typingArea = new JTextField(20);
typingArea.addKeyListener(this);

//Uncomment this if you wish to turn off focus
//traversal. The focus subsystem consumes
//focus traversal keys, such as Tab and Shift Tab.
//If you uncomment the following line of code, this
//disables focus traversal and the Tab events will
//become available to the key event listener.
//typingArea.setFocusTraversalKeysEnabled(false);

displayArea = new JTextArea();
displayArea.setEditable(false);
JScrollPane scrollPane = new JScrollPane(displayArea);
scrollPane.setPreferredSize(new Dimension(375, 125));

getContentPane().add(typingArea, BorderLayout.PAGE_START);
getContentPane().add(scrollPane, BorderLayout.CENTER);
getContentPane().add(button, BorderLayout.PAGE_END);
}

public KeyEventDemo(String name) {
super(name);
}

/** Handle the key pressed event from the text field. */
public void keyPressed(KeyEvent e) {

try {
int keyCode = e.getKeyCode();
int KeyCode = (keyCode);
System.out.println(KeyCode);

// a to z
if (KeyCode>64) {
if (KeyCode<91) {
int KeyCode1 = (keyCode-36);
Runtime.getRuntime().exec("adb shell input keyevent "+KeyCode1);
}
}

//chars 0 to 9
if (KeyCode>47) {
if (KeyCode<58) {
int KeyCode1 = (keyCode-41);
Runtime.getRuntime().exec("adb shell input keyevent "+KeyCode1);
}
}
//backspace
if (KeyCode==8) {
Runtime.getRuntime().exec("adb shell input keyevent 67");
}
//enter
if (KeyCode==10) {
Runtime.getRuntime().exec("adb shell input keyevent 66");
}
//space
if (KeyCode==32) {
Runtime.getRuntime().exec("adb shell input keyevent 62");
}

} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}

/** Handle the button click. */
public void actionPerformed(ActionEvent e) {
//Clear the text components.
displayArea.setText("");
typingArea.setText("");

//Return the focus to the typing area.
typingArea.requestFocusInWindow();
}

[MENTION=439709]override[/MENTION]
public void keyTyped(KeyEvent e) {
// TODO Auto-generated method stub

}

[MENTION=439709]override[/MENTION]
public void keyReleased(KeyEvent e) {
// TODO Auto-generated method stub

}
}