window: Implement the history navigation by Up and Down keys