Arrow keys patch, courtesy of erlehmann