Improve mouse and keyboard testing