Code example for KeyEvent

Methods: getKeyCode

0
 
        mWebView.onTouchEvent(event);
    } 
 
    private void executeKeyEvent(int action, int keyCode) {
        KeyEvent event = new KeyEvent(action, keyCode);
        mWebView.onKeyDown(event.getKeyCode(), event);
    } 
 
    /** 
     * Assumes lowercase chars, case needs to be handled by calling function. 
     */ 
    private static int charToKeyCode(char c) {
        // handle numbers 
        if (c >= '0' && c <= '9') {
            int offset = c - '0';
            return KeyEvent.KEYCODE_0 + offset;
        } 
 
        // handle characters 
        if (c >= 'a' && c <= 'z') {