Live data from Hacker News

A hand-wired USB and Bluetooth keyboard powered by Python

github.com

21–29 of 29 posts

Re: A hand-wired USB and Bluetooth keyboard powered by Python

#21

Nice, if I made it I would replace the capslock with control and "~" with escape. Make the least used keys require combinations, not the often used ones.

I use Caps Lock for both Ctrl and Esc, wouldn't have it any other way. Shift keys are also open/closing parens, holding down the tilde turns the "yuihjknm," section to a numpad, holding down Tab turns jkl; to {}[], etc.

Very handy when programming.

Re: A hand-wired USB and Bluetooth keyboard powered by Python

#23
Great job! I've not seen python-based keyboard firmware before, I'm impressed that it's fast enough to run something like a keyboard.

Without detracting from the code in the post, I recommend that anyone wanting to make and program their own keyboard should take a look at QMK, a widely supported keyboard firmware project that is FOSS: https://qmk.fm/

Re: A hand-wired USB and Bluetooth keyboard powered by Python

#24
A lot of people are asking:

- why python?

- isn't is slow?

Remember that Python is a language spec, there are several implementations.

This project uses a particular implementation called CircuitPython ( https://en.wikipedia.org/wiki/CircuitPython), a derivative project from MicroPython ( https://fr.wikipedia.org/wiki/MicroPython), by the people at AdaFruit.

This implementation runs with a very different VM that can fit within 256k of code space and 16k of RAM.

So, while obviously you cannot expect anywhere near C level of perfs, this is way lighter than CPython.

The advantage is that you get the ease of Python to program your board, including the clean terce language, the memory management and the rich data structures. You can even have a live shell on some embeded hardwares! The whole dev process is so simple: code, copy your module, run.

Of course, some features of CPython are not available.

Re: A hand-wired USB and Bluetooth keyboard powered by Python

#25

Nice, if I made it I would replace the capslock with control and "~" with escape. Make the least used keys require combinations, not the often used ones.

I use Caps Lock for both Ctrl and Esc, wouldn't have it any other way. Shift keys are also open/closing parens, holding down the tilde turns the "yuihjknm," section to a numpad, holding down Tab turns jkl; to {}[], etc. Very handy when programming.

How's caps both ctrl and esc? Can you explain on shifts a bit? I guess you autotab

Re: A hand-wired USB and Bluetooth keyboard powered by Python

#26

Earlier quoted context omitted.

I use Caps Lock for both Ctrl and Esc, wouldn't have it any other way. Shift keys are also open/closing parens, holding down the tilde turns the "yuihjknm," section to a numpad, holding down Tab turns jkl; to {}[], etc. Very handy when programming.

How's caps both ctrl and esc? Can you explain on shifts a bit? I guess you autotab

Oh, they're all hold/tap. Hold CapsLock to get Ctrl, tap to get Esc. Similarly with the shifts, hold to get shift, tap to get ( on left and ) on right. Tab is the same way, hold down tab to transform the keys.

Re: A hand-wired USB and Bluetooth keyboard powered by Python

#27

If you want to make a little macro-keyboard equivalent at a fraction of the cost, I wrote a little guide (with example code) here: https://makeandymake.github.io/2020/05/02/seeeduino-xiao-cir...

this is pretty cool!

I've wanted to hardwire a keyboard, but a full-size one seems pretty intimidating.

Re: A hand-wired USB and Bluetooth keyboard powered by Python

#28

A lot of people are asking: - why python? - isn't is slow? Remember that Python is a language spec, there are several implementations. This project uses a particular implementation called CircuitPython ( https://en.wikipedia.org/wiki/CircuitPython ), a derivative project from MicroPython ( https://fr.wikipedia.org/wiki/MicroPython ), by the people at AdaFruit. This implementation runs with a very different VM that ca…

many people dont realize, but micropython has unix port, and it can be much slower than CPython. micropython's main advantage is size, not speed.

Re: A hand-wired USB and Bluetooth keyboard powered by Python

#29

Earlier quoted context omitted.

How's caps both ctrl and esc? Can you explain on shifts a bit? I guess you autotab

Oh, they're all hold/tap. Hold CapsLock to get Ctrl, tap to get Esc. Similarly with the shifts, hold to get shift, tap to get ( on left and ) on right. Tab is the same way, hold down tab to transform the keys.

Well, well.. why didn't I think of that! Thanks!
Post reply on HN