Mouse movement detection corrections based on Janet’s sourcetree.