How can i function a Key Event in loop for CHARTEVENT_KEYDOWN?

 
//+------------------------------------------------------------------+
//| ChartEvent function                                              |
//+------------------------------------------------------------------+
void OnChartEvent(const int id,
                  const long &lparam,
                  const double &dparam,
                  const string &sparam) {


   if(id==CHARTEVENT_KEYDOWN) {

        case 70://keycode for next market watch symbol F
           a = 1800;
           break;
        case 71://keycode for next market watch symbol G
          a = 2200;
          break;
      }

      ChartRedraw();
   }

}

I want to make it function like when case 57 or F key is pressed once it should trigger a = 1800, when it pressed again it should trigger a = 2200 when it pressed third time it should be 1800 again so it should be looping for these 2 values 1800 and 2200, I am wondering how can i do that?

 
Arpit T:

I want to make it function like when case 57 or F key is pressed once it should trigger a = 1800, when it pressed again it should trigger a = 2200 when it pressed third time it should be 1800 again so it should be looping for these 2 values 1800 and 2200, I am wondering how can i do that?

Count the press, then reset at 2 to zero.