Hack Chat Transcript, Part 1

A event log for Python Your Keyboard Hack Chat with Adafruit

What's in your keyboard?

Dan MaloneyDan Maloney 07/21/2021 at 19:510 Comments

Dan Maloney12:02 PM
OK, we're still waiting for the livestream to start, but we can kick things off here. Wecome to the Hack Chat, I'm Dan and I'll be minding the shop here today along with Dusan as we welcome our friends from Adafruit. Off the top of my head, that's Limor, pt, Jeff, Kattni, Scott, Dan -- anyone else?

Steve M Potter12:02 PM
Hello! Looking forward to learning! My wooden keyboard needs another upgrade:

Mark J Hughes12:02 PM
@Dan Maloney I think @pt is waiting for your go ahead

pt12:02 PM
here we go!

Derek Brown joined  the room.12:02 PM

Dan Maloney12:03 PM
Oh right -- missed that while typing. Let's go!

Derek Brown12:03 PM
Is there a video stream or just text chat?

Fred12:03 PM
Good question

Kattni12:03 PM
There's both!

Dan Maloney12:03 PM
Video stream too -

Derek Brown12:03 PM
There we go!!! Thanks!

Dusan Petrovic12:03 PM
Hello and welcome!

foamyguy12:04 PM
@Steve M Potter That thing is awesome!

Dan Maloney12:04 PM

pt12:04 PM
Python Your Keyboard Hack Chat with Adafruit

limor12:05 PM
scott, jepler pz type intros after done typin

limor12:05 PM
since not everyone is watching yr vids :)

limor12:05 PM
ditto kattni and dan

Jeff Epler12:05 PM
I'm Jeff Epler, I've been working with Adafruit on CircuitPython for about 2 years. I've been into mechanical keyboards for an age, starting with a Model M. More recently I've hand built some keyboards and I'm excited to run CircuitPython on them.

pt12:05 PM
pt, works @ adafruit, 16 years ago, founded hackaday (nothing to do with it now besides being a fan)

tannewt12:06 PM
Hi folks, I'm the lead for CircuitPython. I made custom keyboard a while ago that runs CircuitPython on a feather that is "castelated" with side clippers

Dan Maloney12:06 PM
So the way we like to work is to type questions here, and the Adafruit crew answers them on the video chat. Or we can ask questions on the chat associated with the livestream

Kattni12:06 PM
Hi, I'm Kattni! I've been with Adafruit since 2017. I handle the libraries and lot of the guides. In terms of keyboards, I've been into mechanical keyboards for the last couple of years. I've never built my own but I'm looking forward to that becoming simpler with CircuitPython.

pt12:06 PM
some of the good news is that with the silicon shortage, we're releasing hardware that is available like keyboard / keeb, etc

Dan Halbert12:06 PM
I'm Dan Halbert. I've been doing CIrcuitPython core development for almost four years. In terms of keyboards, I just implemented the `keypad` native module in CircuitPython, which does background scanning for various kinds of keyboards.

Dan Maloney12:07 PM
Will do! Any questions yet?

pt12:07 PM
aaaand! ask us anything about keyboards and more!

Dan Halbert12:07 PM


Keypad and Matrix Scanning in CircuitPython

The keypad module, available in CircuitPython 7.0.0 and later, scans a set of keys or buttons in the background, while your program is doing other things, and gives you key-pressed and key-released events. The module provides three different kinds of scanners, which cover common ways of connecting keys to pins.

Read this on Adafruit Learning System

limor12:07 PM
im ladyada, founder & lead engineer at adafruit. i do hardware designa nd software and firmware

Jeff Epler12:07 PM
What i like about Dan's new module is that together with the adafruit_hid module it is really very short to code your entire keyboard.

Mark J Hughes12:07 PM
@kattni -- we have a similar lab setup. Except yours is way cleaner.

tannewt12:07 PM


CKD63 - Adafruit Feather powered mechanical keyboard.

Post with 15 votes and 1892 views. Tagged with Science and Tech; Shared by tannewt. CKD63 - Adafruit Feather powered mechanical keyboard.

Read this on Imgur

Dan Maloney12:07 PM
I can think of one -- aren't there some chips in keyboards that could be in short supply?

Mark J Hughes12:07 PM
Okay -- so why would someone want to make their own keyboard?

Kattni12:08 PM
@Mark J Hughes It's clean because I needed to use it recently :) It fills in slowly otherwise.

deʃhipu12:08 PM
because you can't buy a good keyboard

limor12:08 PM
we have started doing more keebs because they are not as affected by the siicon shortage (among other things)

morgan12:08 PM
Will the ESP32-C3 have a future with CircuitPython? I love that it support both BLE and USB, is much simpler to implement than nRF5 chips (not to mention much cheaper)

tannewt12:08 PM
morgan, C3's future is with BLE. the usb support is really a serial USB peripheral only

foamyguy12:08 PM
Is it likely that we'll see a full qwerty keyboard that runs circuitpython released by Adafruit in the future?

David Glaude12:09 PM
Any plan to have USB Host in one CircuitPython supported board? I don't know what hardware exactly, but being able to read from a keyboard... and maybe be in between a keyboard and a host with a CircuitPython powered MCU could be interesting.

ukerdrw joined  the room.12:09 PM

Steve M Potter12:09 PM
Ergonomic and fast key layouts:

deʃhipu12:09 PM
samd21 supports USB host...

morgan12:09 PM
@tannewt oh that's a shame, I didn't realize it didn't support HID

limor12:09 PM
so lots of mechanical keeb things coming into the shop - keycaps and cases and swichs and more

Dan Maloney12:09 PM
I suppose you could roll it really old school and do something with a bunch of 74xx shift registers or something?

limor12:09 PM
good news is for keebs, just about any chip can be used - as long as it has USB HID support

deʃhipu12:09 PM
Any chance for low-profile mechanical switches?

limor12:09 PM
which is most chips these days

Kattni12:10 PM
@deʃhipu Yes!

Darrin B joined  the room.12:10 PM

Dan Halbert12:10 PM
we do have shift register support, and have tested it on SNES controllers and other things

deʃhipu12:10 PM
@Kattni Kailh?

tannewt12:10 PM
morgan, yuuuuup. agree. The S3 should be USB + BLE + WiFi

limor12:10 PM
and the RP2040, which slipped in right before the shortage, is a great option

David Glaude12:10 PM
Any progress in non US QWERTY keyboard mapping in CircuitPython, something friendly for developer to create mapping for their country/language.

Neradoc joined  the room.12:10 PM

Derek Brown12:10 PM
A year ago I started down the make your own keypad and was thinking "Adafruit could make this so much better." And now you have. It's pulling more into doing projects and am thrilled you all have jumped into keyboards with Circuit Python.

Kattni12:10 PM
@deʃhipu Yep. CHOC.

Jeff Epler12:10 PM
I wanted to make a custom keyboard was so that I could also control the software in my keyboard. So I did two 3d printed keyboards (one my own design) and put Adafruit itsybitsy microcontrollers in them.

limor12:10 PM
derek, yay thanks!

Kattni12:11 PM
@deʃhipu They're in the shop right now. Reds and blacks anyway.

deʃhipu12:11 PM
@Kattni great, thanks

Jeff Epler12:11 PM
I also did a key matrix for a calculator project which is a keyboard but it doesn't (necessarily) run as a USB HID keyboard

Dan Halbert12:11 PM
re non-US keyboards: we would like to provide extra libraries for non-US layouts. Adding that support to the adafruit_hid library takes a lot of space, so extra libraires is the solution.

Kattni12:11 PM
@deʃhipu Red and white, rather.

David Glaude12:12 PM
So much keyboard noise, I guess it is on purpose and very meaningfull for a chat. :-)

deʃhipu12:12 PM
@Kattni the light blue are great, they are like red, but even weaker spring

Jeff Epler12:12 PM my keyboard design my calculator design

morgan12:12 PM
great! I clearly need to catch up on the state of CircuitPython BLE. PCBs getting sent out tonight

Dan Halbert12:12 PM
we do have BLE HID for nRF52840

Kattni12:12 PM
@deʃhipu Nice.

jorch12:13 PM
I love the idea of circuit python to create your custom keyboards or macros.

My son can now follow up and make his own changes without having to compile or trying to understand more "traditional" programming languages like C just to get started.

limor12:13 PM
dan, moost keebs do not use shift reg - its expensive and clunky. better to use keymatrix scanning & diodes. v cheap

limor12:13 PM
we also have HID support in circuitpy for nRF52840 if you want wireless keebs

pt12:13 PM
@jorch yah! that is the idea, young folks making their own keyboard, calculator, and even digital camera, and maybe even their own phone

Kattni12:13 PM
The HID library is frozen into certain builds for smaller boards, so we can't add non-US layouts to the current library, but we want to refactor it to allow for separate layout libraries.

Dan Maloney12:14 PM
Gotcha. I was thinking more "desert island build", where you didn't have anything else.

Neradoc12:14 PM
oh I am creating a repository of layouts taht can be isntalled with circup, because it's made into a bundle

Jeff Epler12:14 PM
the issue dan referred to:

limor12:14 PM
@Dan Maloney you would still need a USB microcontroller

morgan12:14 PM
I was originally designing for the nRF52840 but I'm just so much more comfortable with ESP32s and it seems like the hardware is *just* getting there... but not quite I guess

Dan Maloney12:14 PM

dwetchells joined  the room.12:14 PM

Mark Guimaraes joined  the room.12:15 PM

Dan Halbert12:15 PM
we have BLE peripheral support for ESP32 (not ESP32S2): see our Airlift boards

limor12:16 PM
another neat thing weve done is fully dynamic and confugurable usb descriptors

limor12:16 PM
so we can do NKRO

limor12:16 PM
or turn on/off midi and mass storage and cdc, all dynamically

Jeff Epler12:17 PM <-- our proof-of-concept NKRO for CircuitPython. It may be a naive design, we'll refine it

pt12:17 PM
question that came in "does/can the library allow for an easy way to connect multiple controllers? I really like my IRIS keyboard and would love to make some more custom split keyboards."

limor12:17 PM
or make custom HID devices like microsoft dial, or maybe a custom joystick

limor12:17 PM
for inter-chip communications, I2C or UART is not too bad

Thomas Shaddack12:18 PM
random thought. hid gateway/bridge to which the keypresses/events can be sent via uart (or other ways).

Thomas Shaddack12:18 PM
the same interface for usb and bluetooth chips.

limor12:19 PM
KMK uses TRS - you could use async uart, with a series 1K resistor. but really, better to just go with a TRRS

Thomas Shaddack12:19 PM
so the interface itself can be swapped on a whim. or even used as a kvm.

Jeff Epler12:19 PM
I've heard from KMK that TRS (3 wire) connections between split keebs are common. TRRS (4 wire) is better, you could run standard UART or I2S on it..

Jeff Epler12:19 PM

limor12:19 PM

deʃhipu12:19 PM

jayceerail joined  the room.12:19 PM

deʃhipu12:19 PM
i2S is sound :)

Jeff Epler12:19 PM
yeah i2c :)

David Glaude12:19 PM
How flexible is that new USB-HID descriptor feature? Can we "pretend" at USB level to be a device we want to emulate, maybe a Watcom tablet or a joystick or some odd USB device from old gaming console (like the Buzzz).

Dan Halbert12:19 PM
@David Glaude YES

pt12:20 PM
one of the latest guides:

Jeff Epler12:20 PM
@David Glaude that's the idea, generally speaking

tannewt12:20 PM
old gaming consoles are probably not usb

deʃhipu12:21 PM
you can compile a custom VID/PID

Jeff Epler12:21 PM
Limor says it's uncommon for devices to require VID/PID to match, they just look for a matching descriptor