How to create custom shortcuts with Arduino


If you spend a lot of time on your computer, you will do many more tasks. Common functions such as copy and paste can be accelerated with shortcuts (Ctrl + c and Ctrl + v on Windows), but other commands are not well known or require seemingly impossible writhing.

An option to make your computer life a little easier is a custom shortcut keyboard made with an Arduino-compatible microcontroller board like the Pro Micro.

This small card is able to emulate a human interface device, or HID, based on sensor inputs or presses on buttons, so you can use it to reproduce the function of 39, a keyboard or a mouse. 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 on your desk.

In addition to a microcontroller card, you will need:

You can even do without the breadboard and simply solder the buttons to your microcontroller, but it's best to keep it because making connections will be much easier.

Solder the headers (which look like rows of pins, and are probably included) on your microcontroller card, and then plug it into the business card, overlapping the channel in the middle. Plug the two buttons in the same way.

Strip the wires if necessary, then connect them to the holes in the appliance plate next to pins 2 and 3, and plug the other end of each wire next to the connector closest to each button.

Connect the other side of each button to any point in the negative connector column on the display board, then pass a last wire from the negative to the ground pin on the microcontroller board. (GND). Refer to the picture above if you have problems.

Now, when you press a button, it will connect pin 2 or 3 to ground (the negative column), telling it to perform an action. To complete the project, copy and load this sample file into your microcontroller using the Arduino IDE. When you do, select "Arduino Leonardo" as the card, as well as the appropriate communication port (COM). Once the file is installed on your microcontroller, your computer will recognize your creation as an HID and you will be able to play or pause media content with the touch of a button.

If you want to control the volume in the same way, download and install this code from my GitHub page. Instead of playing and suspending multimedia content, you can control the volume of your computer using the two buttons on the drawing board.

This is of course only the beginning of what you can do with this type of custom interface. Multiple buttons, or even sliders and rotary inputs, can be used to add more shortcut keys or allow you to adjust the speaker volume or other parameters by turning a knob as you would with a radio. You can even connect a motion sensor to such a configuration and use it, for example, to wake up your computer as you enter the room.