Add listeners for pressing enter to make user interface more flexible