4X4 matrix Keypad with I/O Shift Register

I need help.
I have done some research and my little understanding of keypad scanning is that the ShiftIn value of Input Column should return zero (0) when a keypad button is pressed. Mine is only returning 255 (or 11111111) in BIN. All I need is to track the zero value when a key is pressed and then scan the keys matrix to display the pressed key. I will appreciate any help. I have added my code, schematic and a screen shot of result am currently getting.

const int kbdRows = 4;
const int kbdCols = 4;

int LatchIn = 2; //165 pin1
int ClockPin = 3; // 595 pin11 & 165 pin2
int DataIn = 4; //165 pin9
int LatchOut = 5; // 595 pin12
int DataOut = 6; //595 pin14
int led = 7;



int PinState = 0;

char keys[kbdRows][kbdCols] =
{
	{ '1','2','3','4' },
	{ '5','6','7','8' },
	{ '9','0','A','B' },
	{ 'C','D','E','F' }
};

byte KeyIsDown()
{
	int row;
	int col;
  int rowBits;
	int colBits;
	rowBits = 0X10;
	for (row = 0; row < kbdRows; row++)
	{
		digitalWrite(ClockPin, LOW);

digitalWrite(LatchOut, LOW);
			
		 shiftOut(DataOut, ClockPin, MSBFIRST, rowBits);

	digitalWrite(LatchOut, HIGH);
	delay(5);

		digitalWrite(ClockPin, HIGH);

		digitalWrite(LatchIn, LOW);
		delay(5);
        
		digitalWrite(LatchIn, HIGH);
		colBits = shiftIn(DataIn, ClockPin, MSBFIRST);


		

		

		for (col = 0; col < kbdCols; col++)
		{
			
			
			
			
			
			
			if (colBits==0) // not sure what condition to put here
			{

			byte keypressed = keys[kbdRows][kbdCols]; // I know this is the right stuff to return


			}
			
	                return colBits;
			colBits = colBits >> 1;

           

		}
		
	
		rowBits = rowBits << 1;

	}
	

}
void setup()
{

  /* add setup code here */
	digitalWrite(ClockPin, OUTPUT);
	digitalWrite(DataOut, OUTPUT);
	digitalWrite(DataIn, INPUT_PULLUP);
	digitalWrite(LatchOut, OUTPUT);
	digitalWrite(LatchIn, OUTPUT);
	digitalWrite(LatchOut, HIGH);
	digitalWrite(LatchIn, HIGH);
	Serial.begin(9600);

	digitalWrite(led, HIGH);

}

void loop()
{

  /* add main program code here */
	byte retColBit = KeyIsDown();
	Serial.print("ColBit: ");
	Serial.println(retColBit,BIN);
	delay(500);
	PinState = digitalRead(DataOut);
	Serial.print("DataOut: ");
	Serial.println(PinState,BIN);
	delay(500);

}

4X4-IO-ShiftReg.pdf (31.7 KB)

Ahhhhh unbelievable, I made such a mistake in the setup, and nobody pointed it out. I was calling digitalWrite insteadof pinMode.

Ok , I was able to get the 74hc595 and 74hc165 shift registers to shift byte in and out. I discovered the initial trouble was the shared clock setting . Now I need help for the section that scans the keypad and return the key pressed. i have attached the serial display output, here is my current code:

const int kbdRows = 4;
const int kbdCols = 4;

int LatchIn = 2; //165 pin1
int ClockPin = 3; // 595 pin11 & 165 pin2
int DataIn = 4; //165 pin9
int LatchOut = 5; // 595 pin12
int DataOut = 6; //595 pin14

int led = 7;

byte currentByte, hByte,  incoming = 72;
byte dataOuttest;
byte dataIntest;

int PinState = 0;

char keys[kbdRows][kbdCols] =
{
	{ '1','2','3','4' },
	{ '5','6','7','8' },
	{ '9','0','A','B' },
	{ 'C','D','E','F' }
};


byte KeyDown()
{
	//595 Here
	for (int row  = 0; row <= kbdRows; row++)
	{
		digitalWrite(ClockPin, HIGH);
		delayMicroseconds(5);
		digitalWrite(ClockPin, LOW);


		
		shiftOut(DataOut, ClockPin, LSBFIRST, incoming);
		delay(10);

		

		Serial.print("Row: "); // here was to test for Data Shift Out
		Serial.println(row);
		Serial.println("-----------");
		dataOuttest = digitalRead(DataOut);
		Serial.print("DataOut: ");
        Serial.println(dataOuttest);
		delay(600);

	

	//165 Here

	digitalWrite(LatchIn, LOW);
	delayMicroseconds(5);
	digitalWrite(LatchIn, HIGH);

	digitalWrite(ClockPin, HIGH);


	incoming = shiftIn(DataIn, ClockPin, LSBFIRST);

								 //	
	for (int col = 0; col <= kbdCols; col++)

	{
		
		//------------------------------ I dont know what code to put here to enable me scan the keypad.
		//if (!incoming &(1<<col) )
		//{

		//	byte keypressd = keys[row] [col];
		//	Serial.print("keypressd: ");
		//	Serial.println(keypressd);

		//}
		
		//----------------------------




		//+++++++++++++++++


		if(!incoming==0)                    // here was to test for Data Shift In
		{ 

			dataIntest = digitalRead(DataIn);

		Serial.print("Col: ");
		Serial.println(col);
		Serial.print("DataIn: ");
		Serial.println(dataIntest);
		Serial.print("InComing: ");
		Serial.println(incoming);

		delay(600);



      }
	 
	}

	



	} // row end

}




void setup()
{

  /* add setup code here */
	pinMode(ClockPin, OUTPUT);
	pinMode(DataOut, OUTPUT);
	pinMode(DataIn, INPUT);
	pinMode(LatchOut, OUTPUT);
	pinMode(LatchIn, OUTPUT);

	digitalWrite(LatchOut, LOW);
	
	digitalWrite(ClockPin, LOW);
	Serial.begin(9600);

	digitalWrite(led, HIGH);


}

void loop()
{

  /* add main program code here */
 
  
  KeyDown();
	delay(500);

	

}