Added a helper for computing relative mouse motion.