matrix keypad long press button

Hi friends.
I'm trying to make some code on arduino due and i connected to them a keypad matrix 3x5 8 - pins.
I'm using keypad header version 3.1. I get the buttons I press but when I want to get a long press I got a problem. the function getState doesn't help.
here is the code for the section that didn't work

while (customKeypad.getState() != IDLE){
//delay(1);
// if (customKeypad.getState() != IDLE) {
count++;
Serial.println(count);
if(count >= 100) {
KeySoundPlay(temp);
count=0;
return;
}
delay(10);
if ((customKeypad.getState() == IDLE) && (customKeypad.getState() != HOLD)){
Serial.println("IDLE");
return;

}

}
i cant get out of this loop
I also tried the function KeyStateChanged() and it didn't help too.
need you help plz.

Basically you need to stop the scan while the button is pressed, and only commence it on release, but do it in a non blocking way.

You main problem is that you are using a library that you do not understand exactly what it does. Your next problem is that you have not used code tags ( the </> icon ) to wrap your code in. Finally you have not posted ALL the code, including any links to any non standard libraries you have used.

yes I don't understand exactly t keypad header and I took it from arduino playgroun.
i tried to understand it but with out a success. the main function of it works fine I know when the key pressed but know i want to make a long press for 2 seconds and I tried some other function from the header but it didn't work. I don't know when the key is released and thought I stack in the while loop

here is the whole code: my code

I don't have on this pc the libraries I use in case it is necessarily I will add it latter.

hope you could help me

When I followed that link it said:-

You need permission

Which is not very friendly is it? You should post code that everyone should see, either in code tags or as an attachment.

I don't have on this pc the libraries

We need to see the links not the libraries themselves.

I don't understand exactly t keypad header and I took it from arduino playgroun.

Just because it is a keyboard does not mean it is compatible with what you want to do.

Try and think about your final requirements:-
If you want to detect a long press are you going to delay all presses until you see if it is long or not?
Are you going to respond immediately to an initial press and then modify things when you find out some times later it is a long one?
Do you need the code to be doing something else while that key is held down and you are deciding if it is long or not?

Depending on the answers to those questions will dictate what sort of requirements you need from any library you use. It is possible that no library will fit want you want and you will have to write your own code.