Interrupt Calling using 4x4 Keypad

Hello,
I want to call an interrupt function which initiates when the user gives input to the microcontroller via the 4x4 keypad. Say, if the user presses "2" on the keypad, the interrupt specific to the number activates. However, the general syntax for interrupts is given as :

attachInterrupt(digitalPinToInterrupt(pin), ISR, mode)

Thus, I am not sure where to place the statement of (keypressed == 2) in the above statement.

I you -really- want to use interrupts, fine. But when tracking humans? Humans are slow. You can just poll what they do in the main loop(). That's a lot easier.

-jim lee

You can use Google to find your Answer...Also, you can "learn how to use the forum - please read"...

If that is a matrix keypad, Look at pin change interrupts. These can also wake the device from sleep. Care has to be taken to leave the rows and columns in the correct state so detections succeed.
First show your code for reading the keypad.

Thank you for the replies.
Currently my program is in polling jimLee guess I'll stick with it.
Sorry for any inconvenience caused TheUNOGuy, just wanted to get more information on the topic.
Yes, its a matrix keypad 6v6gt. I'll try the method and see its functionality.