How to Create Custom Shortcut Keys with Arduino

If they spend a lot of time on your computer, there are a number of tasks that you run again and again. Common features such as copying and pasting can be accelerated with shortcuts-Ctrl + c and Ctrl + v in Windows, but other commands are not known or require finger snaps that seem impossible.

One choice to make your computer much easier is a custom keyboard shortcut made with an Arduino microcontroller like Pro Micro.

This small board is able to simulate a human interface or HID device based on sensor inputs or button presses so you can use it to play a keyboard or mouse function. Not all microcontroller cards can do this, but those that can allow you to copy and paste text or start and stop your favorite background music without moving your hand across your office.

In addition to a microcontroller card, you will need:

You could even do away with the breadboard and just stick the buttons on your microcontroller, but it's best to keep it as making connections will be much easier.

Attach the headers (these look like row pins, and probably included) in the microcontroller panel, then attach it to the breadboard, enclosing the channel in the middle. Attach the two buttons to the brush in the same way.

Remove the cables as needed and then connect them with the clipping holes next to terminals 2 and 3 and connect the other end of each wire next to the closest connector on each button.

Connect the other side of each button to any point on the negative connector column of the board, and then run a final wire from the negative column on the GND control panel grounding pin. Refer to the photo above if you have problems.

Now, when you press a button, it will either connect terminal 2 or 3 to the ground (the negative column), signaling it to perform an action. To complete the project, copy and upload this example file to your microcontroller using the Arduino IDE. When you do, select "Arduino Leonardo" as the board, along with the correct communication port (COM). Once the file is on your microcontroller, your computer will recognize your creation as HID, and you can play or pause media at the touch of a button.

If you want to check the volume in the same way, download and install this code from my GitHub page. Instead of playing and pausing the media, it will allow you to control the volume of your computer through the two breadboard buttons.

This is, of course, only the beginning of what you can do with this kind of customized interface. You can use more buttons or even sliders and rotary inputs to add more shortcut keys or to adjust speaker volume or other settings by rotating a button as you would with a radio. You could even connect a motion sensor to such a setting and use it, for example, wake up your computer when you walk into the room.