fix input keypress

**Please don't merge yet**. This only partially fix the problem, more discussion coming up.