(New To Arduino) Keypad - Switch Case For Two Inputs

Using Switch Case Statement in another Switch Case Statement to get two inputs and save both inputs in the two different arrays. It runs fine without any errors, the first input works though once i press # nothing happens. Here's my code !!! Thank You !!!

if (int(key1) != 0 and currentState == 1) {

 switch (key1) {
 case '*':
 // sets the first array to zero
 currentState = 1;
 break;

 case '#':
 //saves the value into the first array
//sets the currentState to 2
 currentState = 2;
if (currentState = 2){
switch (key1){ //Once # is pressed the Second Switch begins
case '*':
//sets the second array to zero
currentState = 2;
break;
case '#':
//saves the value into the second array
currentState = 1;
 break;

 case 'A':
 //goes back to the menu
 break;
  
 default:
 currentTValue[0] = currentTValue[1];
 currentTValue[1] = key1;
 break;
 }
}
 break;

 case 'A':
 //goes back to the menu
 break;
  
 default:
 currentT2Value[0] = currentT2Value[1];
 currentT2Value[1] = currentT2Value[2];
 currentT2Value[2] = currentT2Value[3];
 currentT2Value[3] = key1;
 break;
 }
 }
}

Why would you nest 2 switch/cases using the same variable ?

When key1 equals ‘#’ how can key1 also equal ‘*’ ?

if (int(key1) != 0

There is no reason to cast key1 to an int. ANY variable type can be compared to 0.

//sets the currentState to 2
 currentState = 2;
if (currentState = 2){

The if statement contains an assignment, not an equality test. Even if the if statement were correct, it is pointless to assign a value to a variable and then test that the assignment was successful.