custom keypad stuck in loop

Im trying to make a custom keypad that acts like a keyboard but im having trouble with the code. ive only ever used python and this arduino stuff is fairly complicated to me.

wondering if anyone could me fix my code

#include <HID.h>
#include <Keyboard.h>


int pin_count = 6;
int pin_nums[] = {
 2,3,4,5,9,10
};

int button_state            = 0;
int previous_button_state   = HIGH;
long last_debounce_time     = 0;
const long debounce_delay   = 50;

void setup() 
{
//
 Keyboard.begin();
 for (int thispin = 0; thispin < pin_count; thispin++){
   pinMode(pin_nums[thispin],INPUT_PULLUP);
   digitalWrite(pin_nums[thispin], HIGH);
 }
 
 
}


void loop() 
{
 for (int thispin = 0; thispin < pin_count; thispin++)
 {
   button_state = digitalRead(thispin);
     if ((button_state != previous_button_state) && (button_state == HIGH)) 
     {
       if (pin_nums[thispin] == 2)
       {
         Keyboard.release('s');
       }
       if (pin_nums[thispin] == 3)
       {
         Keyboard.release('d');
       }
       if (pin_nums[thispin] == 10)
       {
         Keyboard.release(';');
       }
       if (pin_nums[thispin] == 5)
       {
         Keyboard.release('\'');
       }
     } 
 
     if ((button_state != previous_button_state) && (button_state == LOW)) 
     {
       
       if (pin_nums[thispin] = 2){
         if ((millis() - last_debounce_time) > debounce_delay) 
         {
           Keyboard.press('s');
           delay(50);
           last_debounce_time = millis();
         }
       }
       if (pin_nums[thispin] == 3){  
         if ((millis() - last_debounce_time) > debounce_delay)
         {
           Keyboard.press('d');
           delay(50);
           last_debounce_time = millis();
         }        
       }
       if (pin_nums[thispin] == 10){
         if ((millis() - last_debounce_time) > debounce_delay) 
         {
           Keyboard.press(';');
           delay(50);
           last_debounce_time = millis();
         }        
       }
       if (pin_nums[thispin] == 5){
         if ((millis() - last_debounce_time) > debounce_delay) 
         {
           Keyboard.press('\'');
           delay(50);
           last_debounce_time = millis();
         }
       }

     }
     
 }
 previous_button_state = button_state;
}

The aim is to have a series of switches which can either be pressed for single input or hold the key down for a continuous input, like a keyboard..This is the best i could come up with but the problem is that all this does is get stuck outputting "s" at full speed...What am i missing here? any advice would be massively appreciated

thanks in advanced, Yuxxxi

You need to post your code in code blocks as described in the sticky post:

Read this before posting a programming question ...

You need a separate button_state, previous_button_state, and last_debounce_time for each button input. Just make those arrays also like you did the pin_nums array.

Also, the following line of code is redundant and can be removed:

   digitalWrite(pin_nums[thispin], HIGH);

ToddL1962:
You need to post your code in code blocks as described in the sticky post:

Read this before posting a programming question ...

You need a separate button_state, previous_button_state, and last_debounce_time for each button input. Just make those arrays also like you did the pin_nums array.

Also, the following line of code is redundant and can be removed:

   digitalWrite(pin_nums[thispin], HIGH);

post had been modified and thank you for the help