code: @Override
      public void keyPressed(int keyCode, char keyChar)
      {
          // Validate message
          if (keyCode == keyValidate)
          {
              if (message.length() > 0)
              {
                  sendValidatedMessage();
              }
          }
          else if (keyCode == keyBackSpace)
          {
              if (message.length() > 0)
              {
                  message.deleteCharAt(message.length() - 1);
              }
          }
          else if (Character.isDefined(keyChar) && canAddChar(keyChar))
          {
              message.append(keyChar);
          }
          display = message.toString();
      }
docs: /*
  KeyboardListener