keypad press and displayed in TFT screen

i want to make keypad press to display in TFT screen ( 2.8 " Adafruit ).
how can i drive that ?

#include "TFTLCD.h"
#include <Keypad.h>

#define LCD_CS A3    
#define LCD_CD A2    
#define LCD_WR A1   
#define LCD_RD A0    
#define LCD_RESET A4

#define	BLACK           0x0000
#define	BLUE            0x001F
#define	RED             0xF800
#define	GREEN           0x07E0
#define CYAN            0x07FF
#define MAGENTA         0xF81F
#define YELLOW          0xFFE0 
#define WHITE           0xFFFF


TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);

const byte ROWS = 4; //four rows
const byte COLS = 3; //three columns
char keys[ROWS][COLS] = 
{
  {'1','2','3'},
  {'4','5','6'},
  {'7','8','9'},
  {'*','0','#'}
};
byte rowPins[ROWS] = {44, 45, 46,47 };//ect to the row pinouts of the keypad
byte colPins[COLS] = {48,49,50};//the column pinouts of the keypad

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );



void setup(void) 
{
  Serial.begin(9600);
  Serial.println("8 Bit LCD test!"); 
  tft.reset(); 
  tft.initDisplay();
  tft.fillScreen(BLACK);
}


void loop(void) 
{
 testdrawrects(RED);
    delay(1000); 

char key = keypad.getKey();
    if (key)
    {
    Serial.println(key);
    }
}


void testdrawrects(uint16_t color) 

{
   tft.fillScreen(WHITE);
   int h1=260;
   int w1=90;
   
   int h2=40;
   int w2=40;
   
    tft.drawRect(tft.width() -w1 , tft.height() -h1, 82 , 62, RED);
    tft.fillRect(tft.width()-w1 , tft.height() -h1 , 80, 60, YELLOW);
    tft.drawRect(tft.width()  -2*w2, tft.height() -2*h2, 62 , 52, RED);
    tft.fillRect(tft.width() -2*w2, tft.height() -2*h2 , 60, 50, YELLOW); 
 

    tft.setCursor(40, 40);
    tft.setTextColor(color);
    tft.setTextSize(2);
    tft.println("Press");   
 }

when i tried like this im unable to get it.

tft.setCursor(50, 40);
    tft.setTextColor(BLUE);
    tft.setTextSize(2);
    tft.println(key);

Hi, I have similar problem with my Adafruit 3.5" 320x480 Color TFT Touchscreen in SPI mode. In my project additionally I tried use typical KeyPad 4x4 connected by 8 PIN in my Arduino MEGA. I use Keypad.h library and getKey() function to entry number from KeyPad. When I use the getKey() function, the display stops responding to all my calls. At the same time, the Serial communication is working properly.

Below the code.

// SPI
#include <SPI.h>

// TFT
#include "Adafruit_GFX.h"
#include "Adafruit_HX8357.h"


// These are 'flexible' lines that can be changed
#define TFT_CS 10
#define TFT_DC 9
#define TFT_RST 8 // RST can be set to -1 if you tie it to Arduino's reset


#include <Keypad.h>

const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns
char keys[ROWS][COLS] = {
  {'1','2','3','A'},
  {'4','5','6','B'},
  {'7','8','9','C'},
  {'#','0','*','D'}
};
byte rowPins[ROWS] = {53,51,49,47}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {45,43,41,39}; //connect to the column pinouts of the keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );


// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
Adafruit_HX8357 tft = Adafruit_HX8357(TFT_CS, TFT_DC, TFT_RST);

char buff[11];

void setup(){
  Serial.begin(9600);
  tft.begin(HX8357D);  // TFT Start
 
 tft.setRotation(1); // TFT Rotation
 tft.fillScreen(HX8357_BLACK); // TFT CLS
 tft.setCursor(100,100); // Cursor Position
 tft.setTextColor(HX8357_WHITE);  // Text Color 
 tft.setTextSize(6); // Text Size
 tft.println("Hello Test"); // Text Example TFT OK
 
      for (int i=0 ; i < 11 ; i++) {
        buff[ i ] = getKey();
        Serial.print(buff[i]);
        tft.println(buff[i]);
      }
      
  Serial.print("Serial Output is OK"); 
  tft.println("TFT Output isn't OK"); // TFT Frozen   
  Serial.print("Serial Output is OK");    
      
  
}
  
void loop()
{

     }


char getKey() 
{
    char key = NO_KEY;
    
    while ( key == NO_KEY ) {
        key = keypad.getKey();
    }
    return( key );
}

void tekst()
{ 
  tft.fillScreen(HX8357_BLUE);
  tft.setCursor(180, 190);
  tft.setTextColor(HX8357_WHITE);
  tft.setTextSize(2);
  tft.print("Hello Test");
}