../
Keyboard
a disclaimer.
a qwerty keyboard works just fine.
there are much more important things to be spending time on.
spending the time to make this then learn a new keyboard layout has felt so unessiarly painful, with no significant payoff besides asthetics.
this is my humble opinion.
i'm starting to regret the time spent working on this project.
worked on the key placment first.
inspired by the ferrisweep and simular designs.
had sets of 3 key rectagles on cardstock i moved around till the placemnt and angle felt right under my fingers.
This is designed for the cherry MX switch. I figyred they be the most avalible. The holes are 14x14mm and 5.05mm apart. thats the MX standard.
Made a stencil for the holes.
Then worked on the full blue print.
134.4KiB PNG file, 300dpi, black and white indexed.
use this eqation to get it to print at size if printing at 100% is off.
100 ?
--- = ---
X 15
X is the length of the scale line on the blueprint in cm.
Move the equation around to figure out the new scale '?' to print with.
100*15/x = ?
Made copies of the blueprint onto cardstock paper with a inkjet printer.
Used those stencils to mark the layers onto 1/8inch or 2mm thick plywood.
Cut everthing out with this copping saw. it was my great grandpa's.
Had a small set of files. These were helpful in making the holes the corect size. made sure the switches fit as i went.
Glued the layers together like this with a decent amount of sucsess. the final product was a bit wobly around where the clamps pinched. next time i need to..
- add a sinlge layer
- place a weight on the layer (flat piece of wood)
- wait for it to set
- the reapet for 4 layers
- clamp multiple layers together with londer pieces of wood
because the outside layers were not all flush, i used this belt sander to make them flush. made it very easy.
i was lazy and used this to sand up to 220 grit
used a piece of 400 grit paper after that for a smooth finish. feals real nice :)
didn't get pictures but i finished it with tung oil.
- mixture 50:50 pure tung oil and mineral spirits
- sploch on well with a rag
- wait 1hr for soak
- wipe off exsess
- wait 12 hours
- do a second coat
- took around 48hr for it to fully dry
end result is very nice.
heres the circutry.
The two hands are conected by this braded cable made from 5 lengths of speaker wire.
uses a 4x10 matrix to read all the keys
curent selector
-> ----[ ]-[ ]-[ ]-[ ]-[ ]----------[ ]-[ ]-[ ]-[ ]-[ ]
-> ----[ ]-[ ]-[ ]-[ ]-[ ]----------[ ]-[ ]-[ ]-[ ]-[ ]
-> ----[ ]-[ ]-[ ]-[ ]-[ ]----------[ ]-[ ]-[ ]-[ ]-[ ]
-> -----|---|---|--[ ]-[ ]----------[ ]-[ ] | | |
| | | | | | | | | |
v v v v v v v v v v
read curent
this is to minimise pin usage.
setting a single row low allows you to read which keys are completeing the curct to that row. Because the read pin pull high when not conected low.
there wen't enough pins to read each key indevidually.
diodes are importat to prevent current flowing into other keys than just the row selected, causing key ghosting.
wire each key like this.
the pin of the switch don't mater.
row goes to on pin.
the other pin goes through a diode then to the colum.
make sure the diode faces into the switch. (shown by witch end the colored ring in on.)
The Microcontroler
ended up useing a Adafirut Itsybity ATMEGA32 micro controller, 16mhz 5V.
the cheap pro micro i used borked itself after reprograming it a couple times.
I was using linux Arduino IDE to program this.
Make sure verbos output is on.
File > Prefrances > Show verbos output during: > upload
Whenever you upload the project, double tap the Itsybitsy's reset button.
this puts it into a diffrent state that i don't fully understand. but it works :|
QuicKeyLang
QuicKeyLang is a markup language ment to be lightweight and human readable.
Makes use of certain functions of the Arduino IDE. I'm not sure what other environments provide.
Makes use of the Arduino IDE's Keyboard.h library.
Here is the whole program that runs on the Itsybitsy to make the keyboard work. Just copy paste into the IDE.
quickeylang-arduino-interpreter.txt
The function of the keys are defined by const char
arrays like so.
An example of a key press function
"P1P2P3"
this function will press the '1' '2' and '3' keys all at once.
the 'P' char automaticaly wirtes its realse counter part to the key's release function.
so when pressed, this key's release functionlooks like this.
"R1R2R3"
this function will release the '1' '2' and '3' keys all at once.
the 'R' char realeses keys.
so by pressing this key you might end up with an output of somthing like this.
(if you held it down and your text editor has a key repeating function)
1233333333333333333333
release functions are dynamic and are set to a blank "" when the key is released.
press functions are static and are defined in const
memory.
The Symbols of QuicKeyLang
P
- press the folloing char's coresponding key using Keyboard.press
- write the R
char and folloing char to the release function of this key.
R
- release the folloing char's coresponding key using Keyboard.release
'
- prints the folloing chars till another '
is encontered. useing Keyboard.print
^
- writes the folloing chars to the release function of this key till another ^
is encontered.
W
- waits before exsecuting more code.
- only works in a press function.
- halts the exsecution of a press function till a certain amount of peiriods have passed. The number of which is defined by const waitTime
.
!
- checks if the key was released quickly.
- only works inside a release function.
- only works properly if the W
was used in the press function.
- checks if the number of peiriods passed from a W
is smaller than waitTime
.
- if is not it stops the release function and no further code is exsecuted.
L
- switches layers to the folloing char's numarical value. (not char value, since '1' is actually 0x31)
- "L1"
switches to layer 1.
- the amount of memory you have defines how many layers you can have.
notes
defining special keys is ugly. lets take Ctrl as an example. It equals the char 0x80 with the Keyboard lib.
so defining a Ctrl key press looks like this.
{'P',0x80}
One could define a new symbol for these then use chars like 'C' to press Ctrl.
Whatever this works for me right now.
Layout
As of 2024-10-12 this is my setup.
a hand swap of the Hands Down Promethium layout. After a day and a half of keyborad layout research i think this is as far as i ever wish to care about keyboard layout. Its taking a long time to learn the new layout. QWERTY you stinker >:( stop messing with me. Mussle memory is not there yet.
const char keyMap[4][countRows][countColumns][maxFunctionLength] = {
{
{"^!'p^W'q","Py","Po","Pu","P;", "Pj","Pl","Pd","Pf","Pb"},
{ "Pc","Pi","Pe","Pa","P,", "Pk","Ph","Pt","Pn","Ps"},
{ "P/",{0x27,R},"P'","P.","P-", "Px","Pm","Pg","Pw","Pv"},
{"","","","' ",{'^','!','L','1','^','W','P',C},{'^','!',0x27,BS,'^','W','P',S},"Pr","","",""},
},
{
{{'P',ESC},"'<","',","'>","", "", "'[","':","']",""},
{{'P',T},"'(","L2","')",{'P',G}, "", "'{","L3","'}",""},
{ "","","'-","'+","", "'#","'*","'/","'=",""},
{"","","","L0",{'P',C}, {'^','!',0x27,BS,'^','W','P',S},"","","",""},
},
{
{"'-","'5","'4","'3","':", {'P',PU},{'P',H}, {'P',UA},{'P',E}, ""},
{"'7","'2","'1","'1","'0", {'P',PD},{'P',LA},{'P',DA},{'P',RA},""},
{"',","'6","'7","'6","", {'P',I},"L2","L3","",{'P',D}},
{"","","","L0",{'^','!','L','1','^','W','P',C}, {'^','!',0x27,BS,'^','W','P',S},"","","",""},
},
{
{{'P',ESC},{'P',F1},{'P',F2},{'P',F3},{'P',F10}, {'P',PU},{'P',H}, {'P',UA},{'P',E}, ""},
{"",{'P',F4},{'P',F5},{'P',F6},{'P',F11}, {'P',PD},{'P',LA},{'P',DA},{'P',RA},""},
{"",{'P',F7},{'P',F8},{'P',F9},{'P',F12}, {'P',I},"L2","L3","",{'P',D}},
{"","","","L0",{'^','!','L','1','^','W','P',C}, {'^','!',0x27,BS,'^','W','P',S},"","","",""},
},
};