
Halmak – AI designed keyboard layout - dsego
https://github.com/MadRabbit/halmak
======
gwd
Reading through his blogs, he keeps saying that one of the advantages of his
layout is intentionally alternating keys between hands, and slags colemak for
being "really bad" at that.

But when I was reading up about the colemak, they claimed that was done on
purpose -- that in fact, at high speeds, coordinating alternating keystrokes
between hands is very difficult, and that it's actually a lot more efficient
to have "rolling" patterns where a single hand can type a sequence of
characters in a smooth motion. I can definitely say that the "inter-hand
coordination" is the source of an awful lot of my typing errors.

~~~
networkimprov
The myth of alternating-hand advantage probably dates to the era of mechanical
typewriters, when hammers arriving from opposite sides of the machine were
less likely to jam.

~~~
mkl
Alternating hands was certainly better for my hand joint issues. I found
Dvorak not really faster, but more comfortable, and the alternating hands is a
big part of that. Alternating hands is much better than consecutive keys far
apart on the same hand, and way better than consecutive keys on the same
finger.

------
Trav5
I always thought splitting the keyboard and number pad so I could put the
mouse in the middle would be a great optimization. Finally did it last year
and ended up with tennis elbow. Turns out having my mouse pad a good distance
away from the keyboard gives me a chance to stretch out my arm. That tiny bit
of extra movement was crucial in not pushing my body over the limit of too
much tiny movements resulting in elbow/arm pain. There are other contributors
like using my phone too much in the evenings. But for sure, the keyboard
change pushed me over the edge. I now view micro optimizations like this
slightly differently. Maybe this keyboard layout would be great! But I sure
would pay more attention and watch for negative side effects now.

------
shpx
The thing about computer generated layouts (as with all computer
optimizations) is that it optimizes an evaluation function and not the actual
process of typing. And who knows how closely your function that scores how
good a keyboard is matches the physics and physiology of typing.

And why do people use pieces of perfectly written text. The Backspace key is
like one of my top 5 most used keys and it's always under the pinky.

~~~
notacoward
If you were to read the OP, and especially follow the links to the articles
the author has written about the development process, you'd see that these
shortcomings are exactly what Halmak is trying to address.

~~~
mcphage
> you'd see that these shortcomings are exactly what Halmak is trying to
> address

It’s still all dependent on how good the authors physiological model is. If
their model of hand movements is incorrect, then any generated results will be
incorrect, too. For instance: the author talks about developing a model of
travel distance for various keys. Fine, but (a) it’s based on their own hands,
so it might not be a good fit for others, and (b) the distances are all from
resting hand position, which means that as your fingerS move over the course
of typing a word, those distances should adjust as well. Does the author
account for this? I don’t think so, but it’s not clear.

~~~
luma
My larger concern is that human muscle movement involves a whole lot more than
just the mechanical aspect. Any model that doesn't include some notion of
human perception, cognition, and voluntary muscle control seems like it could
be optimizing with the wrong evaluation function.

~~~
mcphage
Yeah, definitely. A layout that’s slightly worse for your fingers, but
significantly easier to remember, might end up being superior overall

~~~
blotter_paper
One extreme is PLUM, which also includes the mnemonics KJVB, WXYZ, and
READONTHIS.

[https://en.wikipedia.org/wiki/PLUM_keyboard](https://en.wikipedia.org/wiki/PLUM_keyboard)

I actually feel the other way; the cost of learning a seemingly arbitrary
layout is probably less than the cost of using an inefficient layout, in the
longrun.

~~~
mcphage
> the cost of learning a seemingly arbitrary layout is probably less than the
> cost of using an inefficient layout, in the longrun

It might be—but that’s no consolation if you’re less likely to get to the long
run. Or if you get to the long run, find out their models were off, and
realize it was extra time wasted.

------
1123581321
In the era of swiping keyboards, Touch Bar technology, and hyper keys, it
would be interesting to see an expanded project. For example, what is the
optimal position and size for a dynamic OLED touch interface on a keyboard?
Which keys should do something different when held? What chords are worth
putting on a keyboard? It would be especially interesting if usage over time
and the cost of relying on a specialized environment were factored in.

And how about software that watches you type and suggests a more keyboard-
heavy workflow as your speed increases?

~~~
hcarvalhoalves
> For example, what is the optimal position and size for a dynamic OLED touch
> interface on a keyboard?

Far away.

------
aasasd
Dunno if the author took this into account, but the fingers that do the work
also matter: the index and middle finger are considerably stronger than the
ring finger and especially the pinky. See e.g. the Workman layout:
[https://workmanlayout.org](https://workmanlayout.org), and specifically the
illustrative picture: [https://raw.githubusercontent.com/kdeloach/workman/gh-
pages/...](https://raw.githubusercontent.com/kdeloach/workman/gh-
pages/images/usage-viz-grid2.png)

This also means that Windows/Linux and especially Emacs users are sorely
screwed by the prevalence of the Ctrl key in shortcuts. Somewhat ironically,
MS' Natural 4000 keyboard with its gigantic Alt keys is eye-openingly great on
MacOS where those keys serve as often-used Cmd, right under the thumbs, the
strongest digits. And, when Emacs was created, Control was also under the
thumbs.

Also, as a bilingual, I'm pining for a design consideration that punctuation
is on the same keys between the layouts in different languages.

~~~
rkagerer
I use a Kinesis:
[https://en.m.wikipedia.org/wiki/Kinesis_(keyboard)](https://en.m.wikipedia.org/wiki/Kinesis_\(keyboard\))

~~~
dkersten
I almost bought a Kinesis back in 2009 and in the end didn't because of the
cost. I eventually got one in 2017 and now I greatly regret not buying one
back in 2009. Best computer purchasing decision I ever made.

------
pentaphobe
Cool project

Keen to know what sort of typing samples he used - was it mostly people
writing prose, operating shells, other?

Imagine you'd need a fairly large and varied sample set to land good
generality?

~~~
amadeuspzs
From [https://github.com/MadRabbit/keyboard-
genetics](https://github.com/MadRabbit/keyboard-genetics)

"I used a series of articles from various online media. I don't have
copyrights to provide them with this project, so you will have to use your own
source."

and

"Create the text folder and fill it in with *.txt files which you'd like to
use as the test data source. "

It would be interesting to see what a layout full of source code/terminal
history would generate - although you'd have to take into consideration all
variety of autocomplete functionality (tab key usage) in text editors to get
accurate input data, not to mention window switching shortcuts etc.

~~~
pentaphobe
Ah good find, thanks!

Yes, would be very keen to see what sort of result you'd get if (say) you
captured keystrokes directly from a collection of engineers (or indeed a broad
variety of individuals)

Might be trickier though, as I anticipate you'd need to somehow semantically
separate the keystrokes into logical units. Maybe just a time-between-strokes
threshold would be enough?

------
aplaice
Weirdly, it seems[0][1][2], that the layout doesn't do particularly well by
Carpalx's keyboard effort estimator[3], as it gets a total effort score of
2.260, compared to 3, 2.098 and 1.842 for Qwerty, Dvorak and Colemak,
respectively[4] (lower is better). In contrast, the halmak repo claims[5] an
efficiency gain of +134% over Qwerty for halmak, compared to +77% for Dvorak
and +84% for Colemak. Since (one would assume) efficiency and effort should be
approximately inversely correlated, these results don't square.

I have no idea whether Carpalx's or Halmak's keyboard layout
(efficiency|effort) evaluator is more accurate (indicative of real
(efficiency|effort)), but the huge disparity between the two is troubling.

(Obviously, Carpalx and Halmak use different optimisation methods — Monte
Carlo simulated annealing versus an "evolution algorithm based AI" — and these
could well give different results, even with the same scoring method, due to
getting stuck in different local maxima etc., but the issue is that the
scoring methods themselves give different rankings of fixed keyboard layouts.)

Edit: quickly reading through all of the halmak author's blog posts, it seems
that they're aware of the Carpalx project. They describe their (current?)
effort model here[6]. It seems heavily data-based, but it's still difficult to
determine whether it's "better" than Carpalx's.

[0]
[https://gist.github.com/tdegrunt/80e63f464c9a1c336e0f1d4e6aa...](https://gist.github.com/tdegrunt/80e63f464c9a1c336e0f1d4e6aa201a8)

[1]
[https://github.com/MadRabbit/halmak/issues/4#issuecomment-44...](https://github.com/MadRabbit/halmak/issues/4#issuecomment-446316468)

[2] I haven't done the analysis myself and can't be sure that it was done
correctly

[3]
[http://mkweb.bcgsc.ca/carpalx/?interpreting_optimization](http://mkweb.bcgsc.ca/carpalx/?interpreting_optimization)

[4]
[http://mkweb.bcgsc.ca/carpalx/?keyboard_layouts](http://mkweb.bcgsc.ca/carpalx/?keyboard_layouts)

[5]
[https://github.com/MadRabbit/halmak#comparisons](https://github.com/MadRabbit/halmak#comparisons)

[6] [http://nikolay.rocks/2016-10-22-keyboard-
analytics](http://nikolay.rocks/2016-10-22-keyboard-analytics)

------
globuous
Neat project, I've wanted to give it a try for a while but never got around to
do it, great job !

Interesting that it put the comma at the same place as the bepo [1] ! It
obviously recognized that vowels should be placed on the home row on a single
hand, it has it on the right hand when dvorak/bepo have them on the left hand.

It'd be interesting to train it on code as well and see where it positions the
special chars. I personally really like the bepo's choice of putting them on
alt_gr+[right_hand_key] as it allows me to reduce finger stretches to hit
them, that's what was causing me pain on QWERTY, especially with js, and
convinced me to make the move to bepo. I fins lisp is BY FAR the healthiest
language when it comes to fingers, though you do need shortcuts to manipulate
lisp code sanely.

Is the keyboard-gentrics [2] src code the only way of knowing how this was
designed ? I've skimmed the github page and blog it links but cannot find
anything. It looks like its a genetic algorithm ?

[1] [https://bepo.fr](https://bepo.fr) [2]
[https://github.com/MadRabbit/keyboard-
genetics](https://github.com/MadRabbit/keyboard-genetics)

------
xelxebar
Would be curious to see what happpens if we let an optimizer go wild with tye
keyboard structure as well. For a while, I've been wanting to try a Dactyl:

[https://github.com/adereth/dactyl-
keyboard](https://github.com/adereth/dactyl-keyboard)

But I wonder if the space of possibilities contains some wacky hidden gems
that we are just missing.

~~~
aasasd
Considering that fingers rotate on joints instead of extending forward, and
don't crook to the side while doing that, the Maltron/Kinesis/Dactyl shape and
ortholinear layout are pretty intuitive. It's flat boards and the typewriter-
inherited staggered layout that don't make sense in the age of plastic.

------
chansiky
If you're going to go through the effort of redesigning a faster layout, why
not fix everything from the ground up? Why design a layout with key stagger
still a property when we all know that it was a relic of technological
limitations that are not nor will ever be present in any future keyboards?

------
mkl
It looks like this makes q easier to type than w, which seems a bit strange,
and wh seems particularly awkward. "What", "where", "when", "why", and "who"
are all pretty common.

------
equalunique
Looks like an inverted Dvorak

~~~
nemasu
As a Dvorak user, this was my first thought as well.

------
leotaku
What I find the weirdest with all these "efficient" keyboard layouts is that
seemingly none of them ever move things to/from any of the Ctrl/Alt/Shift
keys.

E.g. I find that for me, reaching for the Shift key majorly contributes to
slowdowns and fatigue.

~~~
gedy
I agree and one reason I've mapped spacebar when held down to be shift.

------
zupa-hu
As a software dev, the biggest gain for me was incorporating the arrow keys
under my right hand fingers via a layer switch, and having movement modifiers
under the left (jump word, end-of-line etc).

I think one moves around so much in code that anythng else is micro
optimization.

YMMV.

~~~
mamcx
Mmm... good idea. I also put common marks in the middle:

[http://www.keyboard-layout-
editor.com/#/gists/75c4808455c07a...](http://www.keyboard-layout-
editor.com/#/gists/75c4808455c07affbad9b1911c6fe6a5)

(This is my main driver now)

~~~
zupa-hu
Wow, aren't those too far to reach?

And... What is this website? I can't make any sense of it. Seems to be some
powerful configuration tool to do.. What exactly? :D

~~~
mamcx
Yeah, I made some design mistakes (more at
[https://www.reddit.com/r/MechanicalKeyboards/comments/9wjpg0...](https://www.reddit.com/r/MechanicalKeyboards/comments/9wjpg0/finished_ergo_keyboard/))

This site is part of a few that are used to made your own keyboard.

------
spectramax
I am surprised to see no changes to the top row of 1-0. Can we just get rid of
the number keys and put them in a numpad format on the side? Sequential
numbers on the top are (arguably) worse than numpad.

~~~
intellix
I'm using them all the time for entry and shortcuts. Cmd + 1 for switching to
the first tab/item/thing.

Even bought a tenkeyless gaming keyboard. I was having the opposite thought
that we should deprecate the number pad and just leave it as an additional
hardware add-on for accountants

~~~
egypturnash
I got an external numeric pad mostly for playing Roguelikes. :)

------
clircle
Interesting, but it suits the marginal user. Ideally, I'd want to analyze my
typing patterns to tailor to that (that is, a Bayesian solution where I can
supply my data)

~~~
ethhics
Using the author’s projects, I believe you can make your own “effort map” and
run the genetic algorithms to make your own optimal layout.

c.f. [http://nikolay.rocks/2016-10-22-keyboard-
analytics](http://nikolay.rocks/2016-10-22-keyboard-analytics)

------
kerzol
how it compares to
[https://en.m.wikipedia.org/wiki/Stenotype](https://en.m.wikipedia.org/wiki/Stenotype)
?

------
godDLL
Colemak user: too much pinky use, Cmd+[qxz] is weird

