Leonardo mousekeyboard

Hey guys,

Got a Leonardo set up to send in mouse/key strokes.
Im wondering how exactly the Leonardo interfaces with the OS.
I know the windows OS has a mouse/keyboard API that you can use to programmatically simulate a mouse or a keystroke, but I was hoping the Leonardo does this differently.

From what I understand, the Mouse.click(LEFT_CLICK) method is executed on the Leonardo itself, and the Leonardo acts as an HID usb device. Does this mean the Leonardo will appear to windows as a mouse, and send in a mouse click when this method runs? Or is the Leonardo sending in a special command to the Arduino driver on the machine, and the Arduino driver just sends in a mouse click via the windows api?

basically, I'm trying to avoid autohotkey type methodologies (win api) and confirm that the Leonardo actually pretends its a mouse sending in keystrokes.

a real mouse will not be going thru the windows api, but please correct me if I'm wrong.

It behaves as a USB hid device; It's treated like a hardware mouse.

thanks for the quick reply DrAzzy,

what is confusing me then is how my windows screensaver turns on after its 10 minute configured setting - if the Leonardo is truly functioning as a hardware mouse would, wouldn't each click and mouse movement and keyboard keystroke reset the windows screensaver timer the way an actual keyboard/mouse hardware device would?

I'm running windows 10 in case you were wondering