# Using a micro computer as a macro keyboard device?

not entirely sure this is the best StackExchange board but I bet some of the great members here could at least point me in the right direction.

I'm looking to use one of the microcomputer devices, like a Raspberry Pi, Arduino, etc as macro keyboard.

What I need to do is plug the device into a Mac via USB and have it be seen as a Keyboard and Mouse. I'd then like to trigger scripts which allow the device to send keyboard presses with specific games between in the correct order.

The device itself needs to be what runs these scripts are it's operating on computers where the OS isn't built yet - it's just automating the initial human interaction we need to do now to create the first account and click through all the menus.

First of all does anyone have a suggestion for which device can be seen as a Human HID and appear to the computer as both a keyboard and mouse (as unfortunately I need two mouse clicks to complete the script) and does anyone know of the software I can run to automate the inputs with pauses etc.

Finally it would be ideal if once the computer is booted I can send a signal back to the device to trigger the next script (I will have loaded a script on the computer at this point to run software) if it could tell the device when it's finished and load a second script that would be ideal.

Look forward to suggestions, thanks in advance.

• – pjc50 Dec 20 '18 at 16:24
• There are probably better ways of customizing the setup of a lot of computers, what you are describing sounds hard to get right and fragile against minor software changes, especially because it seems like you are trying to do it without any feedback from the system or display state. – Chris Stratton Dec 20 '18 at 18:57
• @ChrisStratton yeah it's not ideal, but it's the only way possible now with the T2 chips in all the new Macs. It's better than doing it all by hand each time. – Danny Shepherd Dec 21 '18 at 14:00

A better option will be one of the ATmega32U4-based Arduinos, like the Arduino Leonardo or Arduino Micro. The Arduino framework includes Keyboard and Mouse classes specifically for this sort of application.