keypad and serial monitor help

  char key = keypad.getKey();

  

  if (key)

First question. What's with all the blank lines?

Second question. Why are you treating key, which is a char variable, like a boolean? If key equals something makes sense. The value that getKey() returns if no key has been pressed is also true. So, this test is just about worthless. In fact, worse than useless since it causes a two second break before you can read another key press.