Adding member function to get input state and support for closing the window