Welcome to the HP Forums!
I appreciate you taking the time to share your concern and thank you for using this forum, it is a great place to find answers.
I reviewed your post and I understand that the cursor moves on its own randomly.
I’d love to help!
I would like to inform you that this issue usually occurs when there is a virus or a malware on your computer.
I recommend you to run a full scan on your computer and make sure there are no virus or malware. For malware, you can also use malware bite and run that on your computer.
If the issue persists, then follow the steps in the below article.
Let me know how it goes and you have a good day ahead.
To simply say thanks, please click the "Thumbs Up" button to give me a Kudos to appreciate my efforts to help. If this helps, please mark this as “Accepted Solution” as it will help several others with the same issue to get it resolved without hassles. Take care now and have a splendid week ahead.
I am an HP Employee