Keypad value to int value

can someone help me how to get the desired value for my c1foodCount using keypad?

void eventFood1(KeypadEvent key){
  
  int x=0;
  int j=2;
  //char temp[2];
  int temp;
 
  
switch (keypad.getState()){
    case PRESSED:   
      switch (key){
        
        case 'A': 
                  
                  /*
                  if(x>=0){
                    if(x>=1){
                    
                    }
                    x++; }*/
                  c1foodCount = temp; 
                  GLCD.CursorTo(3,4);
                  GLCD.print(c1foodCount); 
                  delay(1000);
                  GLCD.ClearScreen();
                  GLCD.print("How many timez:");
                  keypad.addEventListener(eventFood2);
                  
                  break;
        case 'B': 
         /*         if(x>=1){
                    x--; }*/
                  GLCD.DrawBitmap(schedMenu, 0,0, BLACK);
                  keypad.addEventListener(eventSchedM1);
                  
                  break;
        case 'C': 
                  
                  break;
        case 'D': 
                  break;  
        default:
                  
                  GLCD.CursorTo(j+i,3);
                  GLCD.print(key);                  
                  temp =int(Serial.read());
                  i++;                  
      }
    break;
   
}
}

void eventFood2(KeypadEvent key){
   
  GLCD.CursorTo(3,3);
  GLCD.print(c1foodCount);
  
  switch (keypad.getState()){
    case PRESSED:   
      switch (key){
        
        case 'A': 
                  
                  /*
                  if(x>=0){
                    if(x>=1){
                    
                    }
                    x++; }*/
                  
                  break;
        case 'B': 
         /*         if(x>=1){
                    x--; }*/
                  GLCD.DrawBitmap(schedMenu, 0,0, BLACK);
                  keypad.addEventListener(eventSchedM1);
                  
                  break;
        case 'C': 
                  
                  break;
        case 'D': 
                  break;  
        
                                   
      }
    break;
}}

please post your whole code - and press the CTRL-T before copying to use the auto formatting to improve readability ...