Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. @Override public boolean onKeyDown(int keyCode, KeyEvent event) {
  2.         switch (keyCode) {
  3. ..snip..
  4. case KeyEvent.KEYCODE_MENU:
  5.         // Si presionas la tecla "Menu"...
  6.         String recText = "[INFO] Selecciona algo primero...";
  7.     try {
  8.         InputConnection inputConn = getCurrentInputConnection();
  9.         ExtractedTextRequest textReq = new ExtractedTextRequest();
  10.         textReq.flags = 0;
  11.         textReq.token = 1;
  12.         textReq.hintMaxChars = 1024;
  13.         textReq.hintMaxLines = 20;
  14.         recText = inputConn.getExtractedText(textReq, 0).text.toString();
  15.         recText = "The input box has this content : \n".concat(recText);
  16.         Toast.makeText(SoftKeyboard.this, recText, Toast.LENGTH_LONG).show();
  17.     } catch (Throwable t) {
  18.     }
  19.     break;
  20. ..snip..