74HC595 lag using pushbutton as inputs

hi all
first time poster so bare with me

i am having some severe lag issues with the 74HC595, perhaps it is in my code

what i am attempting to do. using 74HC595 to put out appropriate pin
and light 3x common cathode RGB LED based on button combo

picture 3 buttons
push any single button and you get the corresponding blue
push any combination of 2 and you get corresponding green
push all three you get corresponding red

i am able to run pattern and it executes the loop successfully and precisely

the problem i encounter is with the push buttons
when i loop through the digitalRead for the three buttons
i have assigned values to the button to correspond with the output array index

ie: button 1 = 1, button 2 = 2, button 3 = 4
button 1 = index 1
button 2 = index 2
button 1 + 2 = index 3
button 3 = index 4
button 1 + 3 = index 5
button 2 + 3 = index 6
button 1 + 2 + 3 = index 7

anyway, see the code below for reference

the pattern() methods executes fine
the input() and lights() methods provide me with sever lag
meaning i press button 1, and the blue LED lights up instantaiously, but then takes about a second to turn off!?!?!?

any help and advice would be welcome!

//these are for the shift register
/*

Q1 -| U |- VCC
Q2 -|   |- Q0
Q3 -|   |- DS
Q4 -|   |- OE
Q5 -|   |- ST
Q6 -|   |- SH
Q7 -|   |- MR
GD -|   |- Q7'

*/
#define LATCH_PIN 11 //Pin connected to ST_CP 74HC595
#define CLOCK_PIN 12 //Pin connected to SH_CP 74HC595
#define DATA_PIN 10  //Pin connected to DS of 74HC595

// pattern test
int counter = 0;
int powerup = 0;

/*
  L = 1
  M = 2
  H = 4
  
  L + M = 1 + 2 = 3
  L + H = 1 + 4 = 5
  M + H = 2 + 4 = 6
  L + M + H = 1 + 2 + 4 = 7
*/

int output[8] = {
  B00000000, // OFF
  B10000000, // L
  B00100000, // M
  B01010000, // L + M
  B00001000, // H
  B01000100, // L + H
  B00010100, // M + H
  B00000010  // L + M + H  
};

// pins
int buttonPins[3] = {2,3,4};
int buttonIndex  = 0;
int values[3] = {1,2,4};

void setup()
{
  //shift register pins are output.
  pinMode(LATCH_PIN, OUTPUT);
  pinMode(CLOCK_PIN, OUTPUT);
  pinMode(DATA_PIN, OUTPUT);
  
  //initiate pins as input
  for(int n = 0; n < 3; n++)
  {
    pinMode(buttonPins[n], INPUT);
  } 
}

void loop()
{
  if(powerup == 0){pattern();}
  input();
}

void input()
{
  // reset index values
  buttonIndex = 0;
  
  // read button states
  for(int n = 0; n < 3; n++)
  {
    buttonIndex += digitalRead(buttonPins[n]) == 1 ? values[n] : 0;
  }
  
  lights();
}

void lights()
{
  digitalWrite(LATCH_PIN, LOW);
  shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, output[buttonIndex]);
  digitalWrite(LATCH_PIN, HIGH);  
  digitalWrite(LATCH_PIN, LOW);  
}

void pattern()
{
  digitalWrite(LATCH_PIN, LOW);
  shiftOut(DATA_PIN, CLOCK_PIN,MSBFIRST, output[counter]);
  digitalWrite(LATCH_PIN, HIGH);  
   
  counter++;
  if (counter > 8)
  {
    counter = 0;
    powerup = 1;
    digitalWrite(LATCH_PIN, LOW);    
    shiftOut(DATA_PIN, CLOCK_PIN, MSBFIRST, output[0]);
    digitalWrite(LATCH_PIN, HIGH);    
  }
  delay(250);
}

How are the buttons wired?

One possible reason is that there is no pullup on the inputs and they are floating when not pressed.

Conventionally, you wire one side of the button to ground, the other side to the input, and then digitalWrite(, HIGH) to enable the built in pullup. Note that the button will read LOW when depressed if you do that.

hmm.
i have done previous circuits with pull ups, and pull downs. and was using mini push buttons

in this case i was attempting with arcade type buttons (only 2 wires signal and ground)

i will try with a pullup

that being said. the problem isn;t on press.
on press it lights up right away. it's the turning off (releasing button)

but nothing that could cause lag in the code right?

So exactly how are you wiring up the buttons? You should have a pull up resistor on each input and have the buttons wired between the input and ground.
Also take out :- delay(250);

here is the breadboard layout

i also noticed on the shiftout tutorial there is a 0.1"f capacitor on data pin

Your buttons, or at least the inputs they are connected to, are not pulled up (unless in software, but then your buttons would have no effect since they are connected to +5V anyway, via the series "pull-up" resistor, and not GND).

Take a look here: http://www.seattlerobotics.org/encoder/mar97/basics.html

Oh, and I wouldn't put a capacitoron the data or clock lines, espcially 0.1uF is far too much imho. But then I didn't really know about the really nice tutorials by Grumpy_Mike here: Protection But as you can see no 0.1uF there, around 100pF it seems, and then for protection. Depending on your circuit, you might not need it.

thanks for the reply

does this one make more sense
the arcade push buttons are only 2 wire ground and signal

I'm sorry, forgot to mention one important thing, where is your series resistors for the LEDs?

does this one make more sense
the arcade push buttons are only 2 wire ground and signal

As for the buttons, not really. Btw where did they go, did you replace them with jumpers? Anyway, did you look at the first link in my post above? http://www.seattlerobotics.org/encoder/mar97/basics.html

thanks for the help
the link provided was very helpful

the buttons are still there in the image
they are 2 foot buttons now available in fritzing since last update

also for the LED i do not require the resistors on the breadboard since the resistors are on the PCB of the LEd carrier see image

i managed to get things going thanks to the links provided, i added the resistors and the code ran smoothly

i ended up changing the arcade buttons from the cheapy suprplus store to the sanwas