moved key listener into panel class