Controlling membrane keypad with a CD4021 shifter

Hi, I just bought my first arduino yesterday and managed to set up LCD on it, but now I am out of pins to connect my 4x4 matrix keypad. After doing some search, I decided to try Arduino ShiftIn example. http://www.arduino.cc/en/Tutorial/ShiftIn. I produced the exact circuitry using a CD4021B 8 bit shifter (without VCC and GND as matrix keypad does not require them). However, when I check out the results all I am seeing is 11111111, pressing buttons does not change this output. I am new to electronics, I come from a software development background. Can anyone guide me to right direction on how to make my matrix keypad work with shift in method?

PS: My keypad: http://www.ebay.co.uk/itm/New-4-x-4-Matrix-Array-16-Key-DIY-Membrane-Switch-Keypad-Keyboard-Touch-Pad-3M-/321064830673?_trksid=p3284.m263&_trkparms=algo%3DSIC%26its%3DI%26itu%3DUCI%252BIA%252BUA%252BFICS%252BUFI%26otn%3D21%26pmod%3D321167207388%26ps%3D54

Show us a schematic how you wired things up.
Show us your sketch.

I am using 8x10kOhm resistors with CD4021B shifter. Keypad only has data out pins. No VCC or GND required. But I connected GND as shown in the example on ardouino's official tutorial.

Do you have a link to the keypad.
Also a picture of the keypad might be of some use.

This is the keypad:
http://www.ebay.co.uk/itm/New-4-x-4-Matrix-Array-16-Key-DIY-Membrane-Switch-Keypad-Keyboard-Touch-Pad-3M-/321064830673?_trksid=p3284.m263&_trkparms=algo%3DSIC%26its%3DI%26itu%3DUCI%252BIA%252BUA%252BFICS%252BUFI%26otn%3D21%26pmod%3D321167207388%26ps%3D54

This is a 4X4 keypad which has to be read by placing a High on a given row then reading the 4 columns to see if a switch is being pressed. Then the next Row ....

So I guess, it wont be able to achieve this with a shifter because I won't be able to set specific row high? I need to use an IO extender?

If you have the pins you can use your Arduino

You need no IO extender. You have to change your circuit a little. The three gates in up part is not necessary, but when you connect it to interrupt, you got event (any_key_pressed) :wink:

Hi,

...And what about dealing with 5 x 4 ??

Ciao,
Rafa.