Mouse Jiggler in CircuitPython for ATSAMD21 (M0) or Raspberry Pico
Requires CircuitPython M0/Pico higher than version 7.0.0 (support for code.py rather than rebuilding CircuitPython).
The code is self explanatory but do make sure it works before adding boot.py
! For the Pico, with no inputs, there's no choice but to fly in the face of the advice from Adafruit and could lock you out.
Links to UF2 bootloader erase files for M0 and Pico.
Worth reading this Adafruit howto on customising USB devices for more information.