Fixed key input handling, using bindings instead of listener (works on Win); refactoring