Mouse extension

how does this work?

If you mean by this extension:
All of the hardware devices[?] are able to show up as a mouse to the connected computer via something called the “HID” standard. (Which stands for human interface device) Your hardware like the Meowbit and PyGamer can pretend to be a mouse and move the cursor around on a computer!
The same thing applies to the keyboard extension, except it allows you to send keystrokes to a computer.