static int getKeyEventFromUnicodeKey(char key) {
    if (key == '\b') {
      return KeyEvent.KEYCODE_DEL;
    } else if (key == '\r') {
      return KeyEvent.KEYCODE_ENTER;
    }
    for (Keys seleniumKey : keyMapping.keySet()) {
      if (seleniumKey.charAt(0) == key) {
        return keyMapping.get(seleniumKey);
      }
    }
    return -1;
  }
Maps unicode keys to Android keys codes.
selendroid-server/src/main/java/io/selendroid/server/android/WebViewKeys.java