This question already has an answer here:

I want to use the gpio pins on the pi too use it as a mouse for a PC. Can it be done? If yes then how? I want to use python.

marked as duplicate by Ghanima May 1 '18 at 18:30

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


Why not using a Pi Zero (W), which can operate in the so-called USB gadget mode? The Pi Zero (W) then appears as a normal USB mouse/keyboard to the PC. Please note that this isn't possible with a Pi A/B, but only with the Zero Pis. Using USB gadget mode avoids having to emulate serial mouse, unless you have a really old PC system which hasn't USB support.

  • I don't have a Pi Zero🙂 – Adarsh Aug 20 '17 at 5:01

Not the answer you're looking for? Browse other questions tagged or ask your own question.