graph_input: moved all input code away from graph_sdl

I'm thinking of making input multithreaded.