improved KeyPad handling