micropython based keyboard

Showroom for MicroPython related hardware projects.
Target audience: Users wanting to show off their project!
Post Reply
Posts: 220
Joined: Fri Dec 13, 2013 9:25 am

micropython based keyboard

Post by torwag » Thu Aug 28, 2014 2:32 pm


this is for now nothing more then an idea and this thread should help to do some brainstorming.
For quite some time I'm looking into creating my own keyboard.
The best DIY keyboard I found is called ergodox ... well best in terms what seems important to me.


Based on this, people created already impressive beautiful keyboards. E.g.

http://almightyglod.com/ErgoDock_Rev1/A ... C_0494.jpg
http://geekhack.org/index.php?action=dl ... 2576;image

well the mechanical part is one side. On the other hand it requires a keyboard controller.
ErgoDox is using a Teensy microcontroller board https://www.pjrc.com/teensy/... which I am pretty confident does a good job.
There are already certain versions of firmware with different feature sets.

My idea would be to replace the Teensy board by a pyboard, because I believe the pyboard as a keyboard controller would really show some of the great advantages of the python on a microcontroller.
* Users could easily reprogram almost every function without the need to compile and flash
* Faster prototyping, programming, debugging and testing via python
* More powerful for heavier tasks
* Large storage capacities
* Keep the software/firmware modular it will be easy for each user to configure the functions they need. Again no compiling, no firmware flashing, no makefiles, etc.
We could even consider a plugin catalog if more and more features get contributed.

What I would love to get beside the standard keyboard functions (in no particular order):

* Keyboard layers (done with the teensy already) so you can switch between different keyboard languages, layouts (colemak, dvorak, etc., or e.g. switch to a mode for a certain applications... for example a latex-greek mode in which pressing button "a" will return \alpha
* Add a small display (e-ink?) for certain features
* Integrated password manager: Select a certain entry (via the e-ink display, e.g. ebay) type the master-password and the keyboard will return the individual password. More could be added like password generator, etc.
* Simple Keyboard Macros: Quit similar to Emacs.... after starting a macro every single key-press will be recorded. Stop recording and repeat the macro as often as you want.... a killer-feature for repetitive text editing tasks.
* Complex keyboard macros: Use python to create much more complex macros: E.g. a macro number(10) would return 1 2 3 4 5 6 7 8 9 10
* Add a calculator via the e-ink display, the result can be send via keyboard. E.g. you type 10*0.05/2 and the keyboard will send 0.25 to the PC.
* Unit / Money converter (type 2 inch and the keyboard sends the corresponding value in e.g. cm)
* Mouse emulation by keyboard buttons
* Show system resources on the e-ink display
* 2-way authentication via the keyboard (password and the keyboard are required to grant access)
* store keys and other authentication files for access (e.g. for logins via ssh, encrypt your emails)
* different input methods similar to emacs... e.g. type "o to get ö or ae to get ä. Japanese and Chinese users might even ask for a complete IME (input method editor) via the e-ink display

There is plenty more, which I don't consider important or not really be a core keyboard function (since some would need additional software on the PC side) , but others might find it useful:

* Assistance for bitcoin and other payment systems,
* Logging,
* On-the-fly spell-checking (auto-correction for often misspelled words),
* Email and social network notification even if the PC display is on standby,
* Analyzing of typing habits (e.g. the top 20 words which are followed by backspaces),
* Assistance for certain GTD, Pomodoro, etc. methods
* Notes / TODO taking, (even if PC is off, sync with PC)
* Calendar alarms (even if the PC is off, sync with PC)
* Dictionary

Why doing all this on/in the keyboard directly instead of using host computer software?

Simply because it would work out of the box everywhere on all OSes. If you start to work on another computer, there is no need to install several programs and get your data into it. Simply attach the keyboard and you are ready to go. It will also assist almost any kind of software. If you are a heavy photoshop/gimp user you might get extensive keyboard maps for gimp/photoshop hotkeys. However, if you are a LibreOffice/MS Office user you might have a layer tailored for LibreOffice/MS Office.
Many of the features are even application agnostic:
If you are a programmer, you might get macros and templates for a certain programming language e.g. you type:

Code: Select all

ite <tab> # for if then else
and the keyboard sends

Code: Select all

if <cursor> : 
  #add true statement here
  #add false statement here
to the computer
or you want to comment out the next 5 lines of code simply enter the macro mode and write something like:

Code: Select all

the keyboard will send to the PC

Code: Select all

<Home> #
 <Arrow down> <Home> #
 <Arrow down> <Home> #
 <Arrow down> <Home> #
 <Arrow down> <Home> #
I know good editors can do this as well, but those will work always in the same way in emacs, vim, nano, sublime, notepad++ or eclipse, even in MS Word if this is the editor of your choice.

My problem?
I always have nice ideas (hope that one is nice ;) ) but struggle to find enough time to do all that. Thus, I am looking for some more people to start this together. In addition those keyboards are rather expensive mainly due to the ordering of the cherry-based key switches (one needs about 90 and they add up quickly) and the enclosures, if we could arrange a group order we might save some money too.
I welcome any ideas, suggestions, comments, help, etc.

<Changelog 28.08.2014>
Added some more examples and reworked the text a bit

Posts: 11
Joined: Fri Aug 01, 2014 10:40 pm
Location: Latvia

Re: micropython based keyboard

Post by CRImier » Mon Sep 08, 2014 9:16 am

That would be a truly wonderful project. If it gets finished, I'll make my own version =)

Post Reply