forum

Osu! Keyboard Recipe - For the DIY Minded

posted
Total Posts
95
Topic Starter
The Gambler
:D Okaerinasai minna!

UPDATE August 12, 2018: The newer guide has now been posted in my Github page as a doc file. I will keep the old guide here until I figure out how to format the newer guide into BBcode. Enjoy everyone :)

I would also like to clarify that this thread's official support system is only in English. Those who understand other languages as well as English are encouraged to contact me through PM to relay other issues posted here in different languages. I do not think I can satisfactorily help you very well even with Google Translate. I might try, but GT has inconsistent luck with different languages.

UPDATE June 21, 2018: When posting your code in the threads, please use the [/code] format to properly format your code. It'd be nice code in its full, monospaced glory. Otherwise, carry on below

WELCOME EVERYONE !!!

Seriously, if you find yourself frustrated with the osu! keyboards going out of stock here's a guide on how to build your own controller. Keep in mind that this thread does not go into specific designs in order to keep this thread flexible for other gamemodes. (Mania controller, Taiko, etc.)

Also post your builds here if you'd like. It'd be nice to see what the maker community in osu! can come up with.


A shopping list to consider:


Electronics - the heart of any osu! keyboard build
- Teensy 3.1, 3.2, LC, etc... or Arduino-based stuff like the Micro, Trinket, Due, Leonardo, etc...
- 4 x Cherry MX switch of choice (salvaged or new) (Get plate-mount if mounting via the plate; use PCB mount if your case is thick)
- 4 x Cherry MX key caps of choice (salvaged or new)
- 24-30 AWG wire
- Solder
- Soldering Iron
- Arduino IDE w/ Teensy Bootloader
- LEDs (Optional)


Case - it matters not how you do it, as long as it holds the goods properly

The way of the 3D printer
- 3D printer (or get it printed somewhere)
- Nuts and bolts of choice (I used M5 nuts and bolts)
- Sketchup (or Blender; any 3D modelling program of choice)
- Filament of choice

The way of the laser or CNC cutting

- AutoCAD or Solidworks -> basically anything that can generate a g-code compatible file.
- Sheet metal or acryclic (1.5mm for metal, 2mm - 2.5mm acrylic)
- A shop that can cut for you or access to a cutting machine.

The way of the ghetto

- Some sheet acrylic or metal (or tupperware)
- A dremel


Some design tips

THE CASE
- To plate mount a Cherry MX switch, you must cut 14mm x 14mm squares each. A standard keycap (non-modifier) is 18mm x 18mm. You must space them accordingly in design and in fabrication. Data sheets for Cherry MX are online. Model your case based on that
- Make sure your plate isn't more than 2mm thick with plate-mounted switches; you will run into switch problems. Use PCB mounted switches with thick cases, preferably with hot glue.
- Plan a resonable size that will fit both microcontroller and the switches. If possible, do not mount microcontroller beneath switches, lest you want massive kinking like mine does
- Make sure the Micro-USB port is accessible. Unless you design the KB with a non-removable cable: in which case, plan enough space for that extra bit of cable.
-- When using a 3D printer, remember the slicing software needs a compatible file, so do some research on the printer you're using and export accordingly. Same applies to CNC/laser cutters.


Electronics

- Only the inputs need to be wired in parallel. Ground can all be wired in series as they all lead to the same ground pin.
- Adding LEDs? Find 3mm flange less LEDs. Remember that (for a brand-new LED) the longer wire is generally positive and cannot be wired the other way.
- Be extremely careful of soldering. Unless yours is outfitted with headers or a breakout board, the dangers of frying your chip is high.


Coding/Extras

- Keyboard libraries are on github and Teensy website. Find those
- Don't bind two keys to the same keyboard button. Osu! locks up any key being pressed at the moment


-HAVE FUN!!
Example Wiring Diagram
I hope you know pullup resistor configurations. Google is you friend if you don't.
External resistors only if your microcontroller doesn't have internal resistors.

Example Code for the Teensy controller, mind that you will have to experiment a bit.
#include <Bounce.h> // this is needed to use the bounce library


#define KEYP_1 KEY_Z // here we are making it easier to change the key bindings later

// button pins
const int key_1 = 0; // input pin for your keyswitch; not necessary but helpful for doing other things like LED effects

Bounce button1 = Bounce(0, 8); // first number is pin number and second number is debounce time

void setup() {
pinMode(key_1, INPUT_PULLUP); // here we are telling the teensy what pin 0 is being used for
}

void loop() {

button1.update(); // this is reqired for your code to actually send the keypress to the computer

if (button1.fallingEdge()) { // fallingEdge is when the key is pressed
Keyboard.press(KEYP_1);
}
if (button1.risingEdge()) { // risingEdge is when the key is not pressed
Keyboard.release(KEYP_1);
}
}

Mind you that pullup function only works with resistors built into the controller. Otherwise, using external resistors, use:
pinMode(key_1, INPUT);

For adding more buttons:
#define <KEYP_X> <keycode> // keycode is the keycode for whatever you want the key to be


const int <key_X> = <pin> // pin is the pin your button is connected to

Bounce <buttonX> = Bounce(<Y>, 8); // Y is the pin number

pinMode(<key_X>, INPUT_PULLUP);

<buttonX>.update();

if (<buttonX>.fallingEdge()) {
Keyboard.press(<KEYP_X>);
}
if (<buttonX>.risingEdge()) {
Keyboard.release(<KEYP_X>);
}


Mine ended up like this



Sanwa build







New Build 12/29/2017


Feel free to go nuts with your design. Sorry the tutorial took forever to post

Some words from Thnikk himself:

Thnikk wrote:

If there's anything I'd add, it would be that the Teensy LC is still the best option of the Teensy series for its price and is still more than powerful enough, even if you wanted to add LEDs and do some fancy stuff. Also, the trinket is a nice option but harder to use for a 4-key since there's only 3 pins you can use for input while communicating with the computer, so you'd have to use some magic with resistors to get multiple buttons working on the same pin. They are great as a cheap controller for a 2-3 button keypad, though!


FUTURE PROJECTS
- Hardware switch debouncer
- Interrupt-based actuation Too hard
- Underglow LEDs
- Sanwa build FINALLY DONE

Credits:
- Thnikk - code help
- PJRC - Teensy documentation
- Unnamed room in my university campus
- A handful of people in said room - 3D printing and modeling help
[/box]
shortpotato
howdo i get razer switches?? i heard all the cool kids have them D:
Topic Starter
The Gambler
Call Kailhua for a bulk order
KanoSet
it's sad that i can't get most of the list if not all
rip fun i could get making one
nice btw 8-)
ZenithPhantasm
Flaretech Optical Switch not out yet so no point
Saphirshroom
Pretty cool.
Is it comfortable to play on? Mostly asking because of the screws and the edges, and because it looks very light.
Topic Starter
The Gambler

Saphirshroom wrote:

Pretty cool.
Is it comfortable to play on? Mostly asking because of the screws and the edges, and because it looks very light.

I purposely didn't post any 3D files so that people would learn how to design their own, really. This thread only has design philosophies and tips, not instructions on how to build one.

August 12, 2018 --> 3D Files have been posted. 2015 Gambler, it's time to move on :)

In my situation though, I had a book elevate my hand so I wouldn't hit the edges. The screws were far enough to be a non-issue. The height of the switches were the bigger issue though...

Again, it's all trial and error for anyone undertaking this project. This project took about 4-5 prototype cases before going official.

KanoSet wrote:

it's sad that i can't get most of the list if not all
rip fun i could get making one
nice btw 8-)

pretty sure you can order the switches from digikey and the teensy controllers from sparkfun/adafruit.

Pair that with some sheet metal/plastic and a dremel and there shouldn't be a problem.
Topic Starter
The Gambler
Updated with new info, hope the new stuff is useful.

Also wondering if this thread should be in Development or G&R. It feels like a bit of both.
KanoSet

The Gambler wrote:

Updated with new info, hope the new stuff is useful.

Also wondering if this thread should be in Development or G&R. It feels like a bit of both.
the shipping fees would kill me am sure.. but if i had a chance i defo gonna give it a try school takes so much time :|
i forgot to mention that i don't have a 3d printer nor solder tool so this might be harder than to handle tbh
i would say ask a mod to move it.. development seems to fit more
ZenithPhantasm
I was hoping you would design custom housing for MX switches instead. Ones that are easily swappable.
Topic Starter
The Gambler

ZenithPhantasm wrote:

I was hoping you would design custom housing for MX switches instead. Ones that are easily swappable.
That's where the 3D printer comes in handy, as you can disassemble it easily. The contact points though, are still hand wired. Right now, I'm trying to look for SIP sockets for switches.

That, and I also might possibly have to use a prototyping PCB. But for the time being it's all hand-wired
Topic Starter
The Gambler

ZenithPhantasm wrote:

I was hoping you would design custom housing for MX switches instead. Ones that are easily swappable.
I could go solder right-angled female receptacles onto the teensy board with the GND I/O forked out to a 4-way splitter. Though you still need to solder wires to the switches themselves.
Topic Starter
The Gambler
Build #2 - Different Casing, Same parts




Poku
Looks good and nice guide!

Though I can't get most stuff on the list D:
ArionW
Looks great! I'm planning to build my own osu! keyboard based on ATMEGA8, it may not be so easy in terms of coding, but this microcontroller is almost 20 times cheaper. Although I will probably use your wiring diagram as a reference. So, thanks for that!
Topic Starter
The Gambler
The man has spoken... Thnikk has graced us.
Topic Starter
The Gambler
Testing Build v2

KKoonnraDD
Hey Guys!! I made my own keyboard today. i used MX reds for the keys and a Teensy 3.2. The case is bac becaue i dont have access to a 3d printer so i just had to bend a piece of 1.5 mm perspex.. :lol: Your code sample was very helpful !! thanks ! i set the keys to be K, T which are my initials :oops:


[box=Images]



Topic Starter
The Gambler
Holy shit I thought the thread was abandoned by now... Dude that is awesome.

As for the future builds I'm doing, they're on the back burner due to exams
KKoonnraDD
by the way.. I got my custom Caps today.. so i updated the images :oops:
show more
Please sign in to reply.

New reply