http://flyeric.top/archives/reset-cursor-and-retain-configuration