Thank you very much. Yeah: getting input-mappings is tricky depending on the software you are using. But is there a technical necessity why you need "E" and "B"?
In a few places I have the user open a popup with "E". If they advance and close it with "E" then you have to do extra work to figure out wether or not to re-open the popup when you are closing. So this is an easier and more predictable programmatic solution to preventing an infinite loop.