Multiple key presses on 4x4 keypad

I've seen multikey & keypad state example codes in keypad library. My question is can I detect simultaneous pressing of 2/3 keys to call a function? like detecting 'A' & 'B' pressed simultaneously & that triggers a specific funtion.

I think your first question would be what is "simultaneous" Since even if the user tries to press it exactly simultaneous, for the arduino it will very likely not be exactly at the same time.

So what you'll probably end up making is a program that when a button is pushed waits for another tenth of a second or so to see if any other buttons get also pushed, and then handle those 2 presses as a single press of both buttons.

So if you have a program that can see sequences of pushes, it shouldn't be hard to make it time aware, and combine presses if they're almost simultaneous.

yes..simultaneous presses for the user is what i meant :P

unfortunately keystate (PRESSED/RELEASED/HOLD) is implemented in switch case manner keeping each key individual..

switch (keystate){
case PRESSED:
    switch(key){
   case 'A':
    //something
    break;
    case 'B':
    break;} //end switch for PRESSED
case HOLD:
    switch(key){
    case 'C':
    break;
    case 'D':
    break;} //end switch for HOLD
} // end switch for keystate

now if i want to detect PRESSED condition for both A & B and then only call a function how to do it?

now if i want to detect PRESSED condition for both A & B and then only call a function how to do it?

It is your code that detects the conditions using switch statements with cases. You need to look at the wiring of your keypad, and the way that the keypad library works, to make sure that pressing two keys at the same time does not cause a short circuit.

You need to do that before you worry about how to test for the condition.

Yes..short circuit, wrong detection, ghosting these issues are considered.

Anyway I solved the problem using flags. case HOLD A will set one flag say flagAhold, & case HOLD B will set another flag say flagBhold. Check if both flags are set. If true then call the function & reset the flags.