1 / 4
Macro Keychain (Programmable) — image 1
1 / 4

Macro Keychain (Programmable)

Order a print of this model

We calculate the final price from your selected file. You review and accept it before payment.

Saved on this device.

Model information

Category
Computers
License
GNU General Public License v3.0

This is ideal to carry your favorite shortcut as a macro key with you and execute it on any computer - with just one click, without any setup!

Based on the ingenious Digispark development board for the Attiny85 microcontroller and a simple 6x6 mm push button.

This small keychain acts as a keyboard and provides one integrated push button for an action of your choice. By default “Alt + Esc” is set to quickly hide the current window by pushing it back. The PlatformIO project can be found on GitHub.

Use cases
  • as an emergency macro to quickly hide a window if someone enters the room
  • as a rubber ducky-style BadUSB (please use with care and only in a legal context)
  • as a macro key for an often used (maybe tedious to type) shortcut you want to have on all the PCs you work with (at work, on your private device, …)
  • as a TOTP generator for 2FA (requires a lot of code customization)
Building instructions

The build requires glue as my printer wasn't able to create a case snapping together at that small scale, but I will try my best to change that in the future.

  1. Print all parts
  2. Break of two diagonal legs of the push button and flatten the remaining ones.
  3. Place your Digispark microcontroller board at the border of the body
  4. Place the push button on the small platform inside the body and bend one leg of the push button into the hole of pin number 2 on the Digispark. The push button might be a little diagonal, but that doesn't matter. Solder the leg in place. This should be rather easy, but beware not to shorten anything.
  5. Take both the Digispark and the push button out and solder the remaining leg to the ground pin using a short wire. Keep it as short and as close to the components as possible.
  6. Place both components back inside the body and secure everything with a few drops of super glue underneath.
  7. Glue the lid on top.
How to flash the microcontroller

Download the code from GitHub and open the project in your preferred PlatformIO editor. If you wish to make changes, make them now (see next section). Connect the microcontroller to your PC and hit “Upload”. After it is flashed your macro keychain should be working.

If you happen to use Arduino IDE instead, just open “main.cpp” with it. You might need to rename “main.cpp” to “main.ino”, but I haven't used ArduinoIDE in a while so I'm not sure about that. Make sure to have the right libraries installed. Check the Digispark docs for further information.

Changing the macro

Go into the “main.cpp” file of the PlatformIO project. Look for the function called called “btn_pressed”. Edit the macro to your desired keystroke right after the comment “// CHANGES HERE”. Upload the program.

Further information

Feel free to remix and I would love to see your makes.

Tags