I made a keypad for osu! I guess.
I wanted to make a keypad for osu! for a while already. I had most of the things I needed roughly planned out in one way or another, but there was only one thing left: the casing.
How was I going to do it? I don't really know of any place where I could 3D print one or cut acrylic parts for it... So I started thinking of what I have left around the house and thought of that leftover laminate flooring. yep.
OK.. sounds... weird.. but doable I guess. So then, how am I going to make the plate? cut part of the thickness of the laminate flooring then do square hole through it? Exactly what I did.
I already had leftover Kailh Purple Pro switches and keycaps from when I built my keyboard.
The woodwork(?)
And so the planning for what the layout of the plate will be started.
Then I went on and put that piece of paper into practice...
It looks pretty clumsy and not exactly straight but it is what it is. Putting on bolts and stuff, somehow.
And so I had to move on to the electronics
I bought an Arduino ProMicro for this, it can act as HID devices natively, so it's well suited for this task. Picked a switch and soldered it with wires to a ground pad and one of the numbered pads to experiment with the Arduino.
I never messed around with an Arduino before so it was a new thing for me. Anyway I eventually came up with this, it's short enough to paste it here.
#include <Keyboard.h>
void setup() {
// Telling the Arduino that the switches are inputs //
pinMode (2, INPUT_PULLUP);
pinMode (3, INPUT_PULLUP);
pinMode (4, INPUT_PULLUP);
pinMode (10, INPUT_PULLUP);
Keyboard.begin();
}
void loop() {
if (digitalRead(2) == LOW) {
Keyboard.press('v');
}
if (digitalRead(3) == LOW) {
Keyboard.press('b');
}
if (digitalRead(4) == LOW) {
Keyboard.press('n');
}
if (digitalRead(10) == LOW) {
Keyboard.press(KEY_ESC);
}
if (digitalRead(2) == HIGH) {
Keyboard.release('v');
}
if (digitalRead(3) == HIGH) {
Keyboard.release('b');
}
if (digitalRead(4) == HIGH) {
Keyboard.release('n');
}
if (digitalRead(10) == HIGH) {
Keyboard.release(KEY_ESC);
}
}
* I did it like this, first scan for depress on all keys then press because from what I noticed in this way the keys are scanned evenly, so if I were to mash vbn I'd get something like vbnvbnvbnvbn
, like it should and not those keys in random order like vbnvnbvbnnvb
.
Small update:
- For the bottom I cut a rubber rectangle of an old mousepad. Some foam legs I initially got were making the keypad overall too tall and unstable.
- For adding more weight I got a lead weight for fishing nets and shaped it to fit inside the empty space of the keypad to add more weight to it.
Things I regret not considering:
- I should've left more space in between the keys and the margin that is towards me so it is more balanced when I tap on it from that side, but oh well.
- I considered this but didn't think of a good enough way to solve this: it is a bit tall.
(A few months later and I still use it.)