added keypress handling for windows and ubuntu