Can a momentry switch move a servo 90 degrees both ways everytime its pushed?

I’m an absolute beginner with code, My project is a camera mounted on a 270 degree servo and With a 3pin 3position momentary switch, I want it to move 90 degrees every time the switch is pushed in either direction. for example, push it left the servo spins 90 degrees left, I push it left again, it spins another 90 degrees left. push it right, its pins right 90 degrees, until it hits the end of the servo range. Is this even possible? if not can I set the momentary switch to just keep the servo moving left or right continuously until released? I’ve been working on this project for about a month on my own and this bit is killing me. any help or suggestions would be awesome!

Some servo test code from the past that might function to pan a servo.

#include <Servo.h> 
 
Servo myservo; 
#define leftPin 2    //Active Low
#define rightPin 3   //Active Low
int pos = 90;
int delayPeriod = 50;  // increasing this slows down the servo movement

 
 
void setup() 
{ 
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object 
  myservo.write(pos); // center the servo
  pinMode(leftPin, HIGH);   // turn on pullup resistors
  pinMode(rightPin, HIGH);
} 
 
 
void loop() 
{ 
  if(digitalRead(leftPin) == LOW)  
  {                              
   // in steps of 1 degree 
   if( pos > 0)
      --pos;
    myservo.write(pos);  // tell servo to go to position in variable 'pos' 
    delay(delayPeriod);                      
  } 
  if(digitalRead(rightPin) == LOW)  
  {                              
   if( pos < 180)
       ++pos;
    myservo.write(pos);  // tell servo to go to position in variable 'pos' 
    delay(delayPeriod);        
  }
}

In a month you must have written some code that does something like you want. Please post your best attempt and explain what it does and what it fails to do. Then we'll have something to help you with.

Steve