Live data from Hacker News

My First Keyboard Build

davecooper.org

41–50 of 82 posts

Re: My First Keyboard Build

#41
post #10

Current keyboard designs bug me, to put it mildly. Put a mux on each group of switches, have the microcontroller rapidly scan the muxes to determine which switches are down. And now all of a sudden you have a keyboard that you can actually press down as many keys as you need and it still works. Except it won't. Because USB keyboards don't support arbitrary numbers of keys being pressed at once.

"Because USB keyboards don't support arbitrary numbers of keys being pressed at once." There is actually nothing in the USB or HID specifications preventing USB keyboards from supporting n-key rollover (when using the report protocol -- keyboards using the boot protocol are limited to a 6-key rollover). The reason most don't is simply to reduce cost and complexity. A sufficiently motivated person could build a USB-co…

Unfortunately, specifications are great, but in actuality you have to take a look at what is implemented as opposed to what is supposed to be implemented.

In particular, if you try to go over 6-key rollover, good luck. You end up having to, and I'm not making this up, emulate a USB hub connected to multiple keyboards. It's absurd. And all because of the following:

"However, the compatibility version of HID that all present systems implement limits USB keyboards to reporting a mere six regular keys together with four modifiers. Additional keys pressed beyond the limit will generally cause some of the other keys to be dropped." [http://deskthority.net/wiki/Rollover,_blocking_and_ghosting#...]

"non-working n-key rollover with a USB connection is a side effect of the data packet." [http://geekhack.org/index.php?topic=5572.msg85020#msg85020]

(Effectively, instead of doing make:key / break:key packets, the compatibility version of HID does current_keys_pressed:[array of 6 keys]. Why they didn't stick with the make/break of the PS/2 protocol is beyond me.)

Re: My First Keyboard Build

#42
post #8

If I were to build a keyboard I would definitely take a couple of ideas from typematrix. First of all, staggered keys make absolutely no sense(unles it's actually a typewriter). It takes a week to get used to a straight layout, and it feels more natural. It's not a problem to switch between staggered and matrix layouts either. Second thing I would copy is having enter and backspace between the two halves of the keybo…

The Truly Ergonomic Keyboard[1] takes those ideas even further. Recommended.

1: https://www.trulyergonomic.com/store/index.php

Re: My First Keyboard Build

#43

if anyone doing a hand-wired build has a better/more efficient method of making the cables for the columns, please let me know Use self-fluxing enameled wire. It's insulated with an enamel that melts/converts into flux at soldering temperatures, so all you need to do is wrap a turn around the post of each switch contact for a column, then add solder to complete the connection. Some are sold in a convenient pencil-sha…

Self-fluxing enameled wire is great for more than just a simple keyboard project, too---it scales to microcontroller-scale projects, if you have enough patience: http://elm-chan.org/docs/wire/wiring_e.html

It's a good solution if you have some reason (money or time restrictions) that you can't order a PCB. The biggest downside of free-wiring like this though is that you don't have a whole lot of structural rigidity, but the steel that OP uses more than makes up for this.

Re: My First Keyboard Build

#44
post #25

Earlier quoted context omitted.

The standard staggered keyboard layout not symmetrical. If the layout of the keys were optimal for the left hand for instance, the "u" key should have been slightly to the right of the "j" key in order to have the same experience with the right hand. A good way to see if a keyboard actually tries to be ergonomic is to see if the left and right hand layouts are relatively symmetrical.

This argument is insufficient - even taking it at face value, it's only an argument that an optimal layout will be symmetrical, not that a given symmetrical layout is necessarily superior to a given asymmetrical one. In the context of straight columns, what seems strange about it is that my wrists are naturally at an angle when typing, because the width of my keyboard is less than the width of my shoulders. Straight…

Yes, I'm not saying the TypeMatrix pure grid layout is 100 % ideal, maybe there should be just a little bit of stagger to account for the angle of the wrists - but there should still be symmetry of course. I think the TypeMatrix is far superior to the standard staggered layout though, when it comes to the concerns you raise.

The standard layout is just horrible, reaching "v" and "b" with the left index finger while keeping the rest in home position requires an uncomfortable amount of stretching. Even for the right hand, I think the standard layout errs on the side of too much stagger, which is evident when using the pinky to hit the "/" key. There is certainly a lot more wrist distortion than when using the TypeMatrix - there tends to be less distance between the "a" and "l" keys on a standard keyboard as the TypeMatrix places the Enter and Backspace keys in the middle. I guess the Kinesis Advantage might be more ideal in that regard, though I don't suffer from any significant wrist distortion with the TypeMatrix. My hands tend to look like this when using it: https://ploum.net/images/tmhands.jpg

The small size of the TypeMatrix also makes it a win for me, as I occasionally bring it along with the laptop when I sit in the couch for example.

Qwerty is another inefficiency, and I use Colemak myself. The difference between a standard keyboard and the TypeMatrix is still far from negligible.

Re: My First Keyboard Build

#45
I have not the competences to do something like that but in my opinion this is original hacking. In a small town of Sicily (near where I live) some guys are making incredible stuff with retro - computing[1]. They have restore hold computers like PDP11, apple one with all original components.

[1] http://museo.freaknet.org/en

Re: My First Keyboard Build

#46
post #40

Earlier quoted context omitted.

> and it feels more natural I've always wondered about this - I don't disbelieve that some people feel this way, but is it really a general consensus? And is there a reason we should expect it, I don't see why staggered keys make fundamentally less sense.

Staggered keys make less sense because they were designed for the typewriter - not the human. Ergo keyboards are designed specifically with the human hand in mind - to reduce finger and hand movement, and place them in comfortable resting positions. I would say it is a consensus among people who have used non-staggered layouts for a sustained period - the benefits are definitely noticeable to someone with RSI too. Pe…

> Staggered keys make less sense because they were designed for the typewriter - not the human

Even if this is true, it only demonstrates that the original reason for staggered keys is no longer a factor, not that staggered keys are actually worse for humans.

The rest of your post brings up the same questions as the other reply. Even if straight layouts are superior (I'm willing to believe it), by how much, and what about other factors? A typematrix rigidly-square layout is quite different to (for instance) the semi-straight layout of the TECK keyboard marketed as 'truly ergonomic'. In a sense, this layout isn't even different to staggered keys - staggered rows can be relatively straight if your wrists are angled. I suggest this partly in principle - I do agree that the standard angling of a staggered keyboard is not ideal.

Re: My First Keyboard Build

#47

Current keyboard designs bug me, to put it mildly. Put a mux on each group of switches, have the microcontroller rapidly scan the muxes to determine which switches are down. And now all of a sudden you have a keyboard that you can actually press down as many keys as you need and it still works. Except it won't. Because USB keyboards don't support arbitrary numbers of keys being pressed at once.

Elaborating on this, in case anyone wants to know more details (I'd edit the original, but for some reason HN decides you can't edit comments after an annoyingly short time limit.)

Say you have N free pins on your controller, and you want to read K keys. Find the smallest integer number of columns such that log2(k/c) + k/c Tie each row via diodes to 1 key in each column. Then tie each row to a pin on the controller.

Tie each column to an output of the mux, and tie the input of the mux to Vcc. You'll also probably want to tie each column to a grounding resister as well. Maybe a small cap. (Or just use the chip that does this directly, I can never remember the name. Output selector? Something along that line. "An IC that outputs Vcc on the selected pin and ground on all others".).

Then connect the selector of the mux to the remaining pins on the controller.

To operate, just loop through all valid outputs on the mux repeatedly - probably with gray code, as that way you don't need to make as many pin transitions. Each time you change the output of the mux, read the values of those keys. You'll probably need a mapping of row/column -> key, as well as the previous values of keys. Any time the value of a key changes, output the appropriate packet. (Note: most of the time most keys don't change. As such it may be faster to do a quick check that "old column values == new column values" before checking bits one by one.)

As long as your scan rate is sufficiently high, you shouldn't miss keypresses. (And if you want to get fancy, you can actually borrow a technique from dRAM. Have each key connected from ground to a cap (per-key) to a diode to Vcc. Potentially with a resistor, although the diode might be enough. Then do the above row/column, but tied to the caps / diodes as opposed to the keys themselves. This way you'll be able to read that there is voltage on the cap even if your scan missed when it was down. It also provides a certain amount of debouncing. The disadvantage is that there's a whole lot more per-key.)

Re: My First Keyboard Build

#48
post #44

Earlier quoted context omitted.

This argument is insufficient - even taking it at face value, it's only an argument that an optimal layout will be symmetrical, not that a given symmetrical layout is necessarily superior to a given asymmetrical one. In the context of straight columns, what seems strange about it is that my wrists are naturally at an angle when typing, because the width of my keyboard is less than the width of my shoulders. Straight…

Yes, I'm not saying the TypeMatrix pure grid layout is 100 % ideal, maybe there should be just a little bit of stagger to account for the angle of the wrists - but there should still be symmetry of course. I think the TypeMatrix is far superior to the standard staggered layout though, when it comes to the concerns you raise. The standard layout is just horrible, reaching "v" and "b" with the left index finger while k…

Well, this is interesting to hear, thanks for explaining. I also use colemak, but I've been leaning towards using a wide layout (swapping some punctuation from the normal position to the centre of the keyboard) - it's from this perspective that the typematrix looks unappealing, but I'm happy to believe this is just a misleading intuition. I do like the typematrix movement of enter, backspace etc. a lot, that part is undeniably an improvement.

Re: My First Keyboard Build

#49

A witty and self-deprecating write up of a first dive into hobby hardware - and a great result. I would also check out plover - steganography for the masses. Excellent - keep it up!

I think it is actually the opposite to self deprecating. The tone is the equivalent of an "ipsum lorem". He just wants you to focus in the big picture.

Re: My First Keyboard Build

#50
post #38

If you're interested in soldering together a keyboard, but not having to design everything from scratch, it's worth checking out the Ergodox: http://ergodox.org/ . I built one a month ago, and I'm enjoying it a lot. It's a two-piece keyboard with straight key columns, and six buttons for each thumb. You can order the parts on massdrop, when they start another order: https://www.massdrop.com/buy/ergodox?s=ergodox It's…

Are you familiar with the Kinesis Advantage keyboards? The keys are also separated into two sections but sitting on one keyboard, but no DIY needed.

I just started using one recently, but never used ErgoDox before, and wanted to see if anyone has any experience with using both of them.

Post reply on HN