Refactor input handling, add toggle debug info action