Regarding patent application, to protect a method, the hardware is finally made in this way. How to write?

In practice, unless you make a groundbreaking invention, you can't get a wide range of protection. In your example, the mouse did not appear out of thin air, and the technology was gradually accumulated.

Moreover, the patent law requires that the technical scheme be made clear by the technicians in this field, which is the basis for limiting the technical realization. You can't apply for a patent to open a wormhole and travel to other planets, and others will authorize you even if they don't release similar technology.

As long as the writing technology is realized, it is necessary to write the related hardware structure, method and hardware protection together.

Like a mouse, it writes about circuit structure, and some applications involving computer processing write about virtual hardware.