Digispark Mouse and Keyboard

So i have an Attiny85 based Digispark and i want to use Keyboard and Mouse functions: Sending keystrokes and sending commands to scroll (middle scroll wheel on mouse).

I tried it with the librarie DigiKeyboard.h and DigiMouse.h but it looks like they cant work together.

Then i tried TrinketHidCombo.h but it does not provide any functionality to scroll, only this function that doesn't help much:
mouseMove(signed char x, signed char y, uint8_t buttonMask);

Then i found the Arduino Keyboard.h and Mouse.h and it has the mouse functionality i need, but i think it cant work with Digispark, right?
I get this error: "HID.h: No such file or directory".

Thank you so much!

Right!

The pre installed libraries that come with the Arduino IDE like Keyboard or Mouse (Keyboard.h, Mouse.h) allow the 32u4 and SAMD based boards (Leonardo, Esplora, Zero, Due and MKR Family) to appear as a native Mouse and/or Keyboard to a connected computer. See: https://www.arduino.cc/reference/en/language/functions/usb/mouse/

It does not work with ohter boards like the Digispark, which has it's own librarys.
I did not use Digispark as Keyboard or Mouse before.

But I have used Keyboard and Mouse fuctionallity quite a lot in my projects, but have allways used Arduino Leonardo or Micro for this task. In this setup it worked pretty well.

I'm using

#include <DigiMouse.h>

based on the examples provided in the IDE for the digispark familiy.

I think you should make a simple sketch and post it here in code tags showing your problem with both libs so people can have a look at it.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.