keypad question?

hello all,
i would like to interface a 3x4 keypad with my arduino without using the 74c922 encoder, so what is the code that i could use for this project ?
what will i connect rows as input colums ??????
any one know something ?

u may use 7 pins to scan the key . 4 pins for output and 3pins for input .the input conet to GND wiht a resistance to Pull Low level .then as the key pressed one of the input should be draw high and u can read it. at one time just keep one ouput HIGH and the other pins ouput LOW ,and loop the 4 pins. when the key been pressed u can get the the specific weave of input and output pins.

And don't forget to use some form of software button filtering to eliminate contact bouncing as some matrix keyboards can be pretty flaky.

Lefty

thank you all for your replies, please can anyone just put the schematic of the keypad and the resistors ?

just a 4*4 keypad code .

void setup() {
Serial.begin(9600);
for(i=0;i<4;i++) pinMode((KeyOPin + i), OUTPUT);
for (i=0;i<4;i++) pinMode(( KeyIPin + i), INPUT);
}
void loop()
{
reg = 1;
for (i=0;i<4;i++)
{
for (n=0;n<4;n++)
{
if((reg>>n)&1) digitalWrite(KeyOPin+n , HIGH);
else digitalWrite(KeyOPin+n , LOW);
}
for (n=0;n<4;n++)
{
if(digitalRead(KeyIPin + n))
{
key = key | (1<<(4+n));
key = key|reg ;
}
}
reg = reg << 1;
}

if (key & 0xf0)
{
if (key!=oldkey) { press = 1; oldkey = key ; }
}
else oldkey = 0;

if (press)
{
Serial.print(key,BYTE);
}
press = 0;
key = 0;
}