Added KeyListener and tests