v-usb multi hid

hello all im new to this forum and im happy to part of the community.
i am interested in building a v-usb device that can both emulate a keyboard and a mouse hid while also being able to transmit data back and forth through the computer this is the base of the project

it is a v-usb device that is plug and play with all os's

it will have 2 buttons(one for record and 1 for play) if possible not extreamly important right this minute

it will act as both a keyboard and a mouse (going to be automated like a macro)

will record mouse and keyboard events like a macro and replay them

will store the macro events in eeprom so it will save when powered off

maybe a led indicator

maybe a switch to indicate if you want both mouse and keyboard recorded or one or the other recorded

the aim for this project is to have a universal device to record keyboard and mouse macro and replay them for repetitive tasks if a little bit of software program is needed then that is ok but i want to be able to use this on windows mac and Linux with out having to install special drivers maybe i could use serial data to transfer information back and forth to record the macro and then use the hid to play it back.

any and all help is welcomed and greatly appreciated this is going to be a huge project for me and i would like to try and make this device small and cheap lol

thank you in advance for your help and thank you for the views and consideration

This is not as easy as it looks for you. You're able to emulate a keyboard or mouse on the USB with for example a Leonardo but you won't see the messages the other devices are sending (as your not the bus master but just a slave). You would have to create a man-in-the-middle device which has a bus master connector (USB Host Shield) and a slave connector (a Leonardos USB connector is OK, an UNO might do if you have a ICSP programmer). Then you have to write drivers for the connected mouse and keyboard as well as the USB hub (needed to connect more than one device). Although not impossible this is quite a lot of work and hardware. It will be much easier to do that in software on the target computer, but you probably already know that.

i don't think michael really meant his arduino to be between the pc and a keyboard/mouse, so he doesn't need to write/handle usb mouse keyboard drivers, he said he wants his arduino to BE the mouse and keyboard :slight_smile: correct me if i understood wrong!

have you tried flashing an arduino Uno/Mega 8u2 hip with a custom keyboard/mouse firmware before? Do you have any previous experience about any of the steps you have described?

the aim for this project is to have a universal device to record keyboard and mouse macro and replay them for repetitive tasks if a little bit of software program is needed then that is ok but i want to be able to use this on windows mac and Linux with out having to install special drivers maybe i could use serial data to transfer information back and forth to record the macro and then use the hid to play it back.

My interpretation of this paragraph is the one I described. He wants to record the mouse and keyboard behaviour and plays it back later on. He didn't realise that the Arduino needs to be in between the mouse/keyboard and the PC but that's probably because he doesn't yet understand the USB subsystem thoroughly enough.

If he uses a Arduino Leonardo there's no need to change the firmware of the 16u2, the ATmega32u4 used there has USB (slave) support in the main processor.

Just simulating mouse or keyboard input I understand is feasible as long as you have the right Arduino board which can be programmed to emulate an HID.

Enabling your device to intercept mouse/keyboard events during the recording phase strikes me as a much harder problem. I'm sure it's solvable, but tbh I doubt that the effort to solve it is justified given that all you're trying to achieve can be achieved in software - and I don't think you'll have any trouble finding freeware solutions for the platforms you mention.

i do want to record the mouse and keyboard but i was thinking about writing a little software that translates the keys and mouse movements to a serial connection to arduino then arduino will interpret those serial connections and save them the the arduino will use the emulation firmware for a mouse and keyboard and replay those events made recorded from the serial connection