Extend maximization to four directions and adapt input mapping.