Code example for InputConnection

Methods: commitText

0
    public boolean onKey(View v, int keyCode, KeyEvent event) {
 
        // This handles the hardware keyboard input 
        if (event.isPrintingKey()) {
            if (event.getAction() == KeyEvent.ACTION_DOWN) {
                ic.commitText(String.valueOf((char) event.getUnicodeChar()), 1);
            } 
            return true; 
        } 
 
        if (event.getAction() == KeyEvent.ACTION_DOWN) {
            SDLActivity.onNativeKeyDown(keyCode);
            return true; 
        } else if (event.getAction() == KeyEvent.ACTION_UP) {
            SDLActivity.onNativeKeyUp(keyCode);
            return true; 
        } 
 
        return false; 
    }