Ported old inputhandler class
Merge branch 'master' of https://github.com/tbertore/Mercury.git