The NO_KEY is used by the library "keypad.h". I don't know how it exacly works. Actually I have no idea.
When I wrote the examples for using the keypad library I wanted people to know about NO_KEY. That may have been a mistake.
Anyway, the code
if (key != NO_KEY)
{
// This code in here will only run if you press a key.
}
is telling you that any code you put inside the brackets of this if statement will run
only if a valid key has been pressed.
It may seem more logical to you to write it thus:
if (key)
{
// This code in here will only run if you press a key.
}
-Mark Stanley