Custom keyboard - Page 1
Forum section: electronics / beginners

author: horseguards
author_rank: Newbie
timestamp: June 09, 2025, 04:45:42 pm
content: Is it possible to build a (separate) keyboard for my laptop to my own design: layout, shape (not the standard form), custom keys, etc.? Perhaps there are off-the-shelf solutions? I have no experience of electronics. Suggestions greatly appreciated.Grant (UK).

author: abeyer
author_rank: Frequent Contributor
timestamp: June 09, 2025, 05:55:27 pm
content: Yes, there is a massive community of people doing custom keyboards, with thousands of designs out there already.If you're just starting, maybe look up the QMK firmware and go from there. It supports a huge number of keyboards out of the box, and many of those designs are available, and it's easy to customize to work with your own design.

author: thm_w
author_rank: Super Contributor
timestamp: June 10, 2025, 12:14:53 am
content: Yes, lots of tutorials on youtube and elsewhere:I would look to see if the product you want already exists.

author: BadeBhaiya
author_rank: Regular Contributor
timestamp: June 10, 2025, 06:24:58 am
content: Its not very difficult but its worth checking to see if something similar already exists on the market. If your exact desired feature set (whatever number of knobs, screens, buttons, joysticks etc etc) does not exist as a product, then it may be worth making your own.Here's my attempt. It uses a Raspberry Pi Pico as the controller, and Cherry MX Blue switches, plus an RGB LED. Very basic 3D printed case. A fun endeavour but its not as useful as I had hoped.

author: ahsrabrifat
author_rank: Regular Contributor
timestamp: June 10, 2025, 07:33:02 am
content: Yes. It is possible to make one like this.https://www.pcbway.com/project/shareproject/Custom_Mechanic_Keyboard_STM32_3d1fe280.htmlIt's built with an STM32 MCU, USB-C, Cherry MX switches, and there is a small OLED display to display the layer and other pertinent information.Here is another one.

author: horseguards
author_rank: Newbie
timestamp: June 10, 2025, 11:47:42 am
content: Abeyer, thm_w, BadeBhaiya and ahsrabrifat: Gentleman/Ladies, thank you for the valuable replies; they are greatly appreciated. At least I know it's not a forlorn hope.My intention is to simplify and improve the layout for Excel applications. Basically, letters on the left, numbers on the right, abandoning the the rationale for qwerty.I will look at the possibilities and see how far I can go. Unfortunately, my electronics skills/knowledge is non-existent (I can wire a plug under guidance). I will gladly pay someone to make it (I'm not a cheapskate). Please e-mail if interested.Once again, thank you.Best wishes,Grant.

author: Nominal Animal
author_rank: Super Contributor
timestamp: June 11, 2025, 01:44:13 am
content: Consider using aTeensy 4.0($23.80at SparkFun), because theTeensyduino add-onto the Arduino environment makes it very easy to write the firmware. It has native USB, so when you select one of the Keyboard types to implement, it looks exactly like a standard USB keyboard to your computer; no drivers or anything like that needed. The environment even sets you up with aKeyboardobject you can use to send key events to the computer; see theUSB Keyboard example.For the keyboard itself, you'll do a matrix. You useNGPIOs for outputs, only one active at a time, andMGPIOs for inputs. Each switch connects an output to an input (so a maximum ofN×Mkeys), except that for infinite rollover, you use a diode in series with the switch (so an output is connected to the switch which is connected to a diode which is connected to the input). I recommend using a current-limiting resistor (1kΩ to 10kΩ) per output just to avoid damage if poking at the traces when it is powered on, and common-cathode dual Schottky diodes in SOT23-3 package –– BAS70-05, BAS40-05, or BAT54C for example ––, one per a pair of buttons/switches.The hard part is selecting which buttons/keys you want. No, they're all easy to use; there just is such a large variety in theirfeel. Just take a look at AliExpress or Ebay. Lots to choose from. Nowadays you can find some even in local computers/electronics stores (if you have any left).My own very first microcontroller project was an "Arcade plank", a sturdy arcade digital joystick and microswitch clicky buttons, embedded into a Baltic Birch glulam board, based on Teensy 2.0++ (AT90USB1286, a 8-bit AVR with native USB 1.1). It had a four-bit rotary switch to select between 16 sets of key events it would generate –– so it was a keyboard, not a joystick or gamepad –– because back then, I wanted to play Flash-based platform puzzle games with a better "feel".These are not difficult to design nor expensive to manufacture. In 2017, I designeda carrier board for Teensy LC(Very Cheap, native USB, but no longer sold) that implemented connectors/through holes for 32 buttons, and 9 analog potentiometers (10k recommended, in voltage divider configuration); idea being that you could add it to any arcade cabinet, and have it easily produce the keyboard/multimedia keyboard/joystick events your emulator wants as perfectly native USB HID events (and thus working in all emulators and all environments).In Teensyduino, you simply write aloop()that enables each output at a time, and reads the inputs in parallel to see which buttons are being pressed.Then, you do software debouncing –– I like to use the dead-time approach, i.e. first change is acted upon, but changes are then ignored for a fixed time, for example 20ms. Finally, you use theKeyboardobject to tell the host computer about the changes in key states. That's it; very beginner-friendly.There aretonsof suitable microcontrollers, but note that you definitely want one with a native USB controller, not one that uses a translator chip (to USB serial), because those others do need a driver. If you wanted to go mass production, then I'd look at WCH RISC-V processors like CH32V208RBT6 or CH32V103R8T6, writing the firmware in PlatformIO environment. They are hugely overspecced for this, but only cost a tiny fraction of what e.g. your key switches will cost.For experimentation, I do recommend drawing a key layout in e.g. Inkscape, and printing it out, and then just trying to "type" something using it.I wish I could help you more with this, but I have issues that make me unable to: if I promise anything, or anything is expected of me, I simply lock up and stress out and fail. It's self-inflicted: I burned myself out and fell into depression a few times without seeking help, and ended up with all sorts of issues because of that.

author: horseguards
author_rank: Newbie
timestamp: June 12, 2025, 02:02:10 pm
content: Nominal Animal, thank you for the excellent reply. I'll look into this more deeply. I can relate to your last paragraph. Keep strong.Best wishes,Grant(UK).