[PATCH v4 08/11] bootmenu: factor out the user input handling