Extra small extra macro keys v2.0
Well I took another look at the design of my macro keys project sooner than I expected. I started over with the design of the 3D-printed part of this project, and then moved the buttons and guts over from the previous version.
This design works a lot nicer, and I figured I’d include some sample code for the Arduino Pro Micro here:
#include <Keyboard.h>
int buttonOne = 9; // Pin 9
int buttonTwo = 8; // Pin 8
void setup() {
pinMode(buttonOne, INPUT);
pinMode(buttonTwo, INPUT);
digitalWrite(buttonOne, HIGH);
digitalWrite(buttonTwo, HIGH);
}
void loop() {
if (digitalRead(buttonOne) == 0) {
// Pressed button one
Keyboard.press( KEY_LEFT_CTRL );
Keyboard.press( 'c' );
Keyboard.release( 'c' );
Keyboard.release( KEY_LEFT_CTRL );
delay(500);
}
if (digitalRead(buttonTwo) == 0) {
// Pressed button two
Keyboard.println("A single button press has typed this text");
Keyboard.press( KEY_RETURN );
Keyboard.release( KEY_RETURN );
delay(500);
}
}
This makes uses of the Keyboard.h Arduino library, which you can find documented very thoroughly here: Keyboard on the Arduino Docs
The macro keys are designed to snap on to the top edge of my keyboard, so they sit just above the fn keys. You can set them up to press a key combination, or type out a bunch of text with a single button press.






Mentioned elsewhere on this site
- Archive Archaeology
25 posts total, from unboxing through to custom macro keys for my keyboard.
Related posts
- An Audio Amp v2.0
I went back to the drawing board with the amp design, this time with the goal to make the layout more symmetrical and to move the AUX input to the back of the amp.
- An Audio Amp v1.0
My wife and I like to have the radio playing all night in our bedroom. Our radio only has one mono speaker and it sits on one side of the bed which means for it to be audible on both sides of the bed one person has to have a loud speaker next to their pillow.
- The Xteink X4 E-Ink Reader
I’ve had the Xteink X4 for a couple of months now, a £40 e-ink reader small enough to stick to the back of a phone. I’d seen a few posts about it (Khairul Selamat, Neil Brown, joelchrono, and moddedbear among them), so I got curious and ordered one.
Discussion
No interactions yet
Join the conversation
Reply from your own site with a Webmention (how?).
