Author Topic: Keyboard Layout Analyzer - new forked version  (Read 15200 times)

0 Members and 1 Guest are viewing this topic.

Offline stevep

  • Thread Starter
  • Posts: 36
    • Colemak Mod-DH
Keyboard Layout Analyzer - new forked version
« on: Sat, 02 May 2020, 12:00:30 »
You'll probably be aware of the patorjk.com keyboard layout analyzer, which is a nice web app for experimenting with different layout designs, presenting results in an attractive and user-friendly way.

My only bugbear with it is that doesn't document in much detail how its scoring system works. It's hard to evaluate results if you don't know the methodology that was used to create them. Anecdotally, in the past I have experimented with it and got unexpected results, leading me to have doubts over the algorithm it uses.

Anyway, I have recently taken it upon myself to studying the source code of the analyzer, and documenting how its scoring system works. Not being content with that though, I then started to think of ways that it could be improved. To this end, I have now forked the original repo, and made various changes and, hopefully, improvements. There is always some degree of personal opinion and preference when it comes to layout design, so all my changes to algorithm are documented, so that people can freely evaluate them and decide if they agree or not.

My forked version of the Keyboard Layout Analyzer is here. The documentation is in the About tab.

Have a play around with it and let me know what you think!

Offline Snarfangel

  • Posts: 288
Re: Keyboard Layout Analyzer - new forked version
« Reply #1 on: Sat, 02 May 2020, 13:52:53 »
From the "About" section:
Layouts should also attempt to use index finger heavily with very little or none on pinkies and thumbs.

Why not the thumbs? The space bar is the most used key, and it does fine under the thumb. Putting it under any other finger would (IMO) be worse. And if the space is fine under one thumb, why not the E under the other thumb, assuming you have a Kinesis, Maltron, or Ergodox?

/I put the E and O under the left thumb on my Kinesis Advantage2, and it works just fine.

PS I'm not knocking your effort. I love seeing new keyboard layout analyzers!

Offline stevep

  • Thread Starter
  • Posts: 36
    • Colemak Mod-DH
Re: Keyboard Layout Analyzer - new forked version
« Reply #2 on: Sun, 03 May 2020, 07:55:01 »
From the "About" section:
Layouts should also attempt to use index finger heavily with very little or none on pinkies and thumbs.

Why not the thumbs? The space bar is the most used key, and it does fine under the thumb.

Yes, I totally agree. The section you quote is where I am critiquing the algorithm in the original patorjk analyzer. I'm saying that to be successful under that algorithm, layouts should weight index and (especially) middle fingers excessively, and that thumbs are insufficiently valued. My changes include doubling the value of thumbs and making middle and index fingers equal in effort to rebalance this somewhat. I probably need to reword that section to make it clearer.


« Last Edit: Sun, 03 May 2020, 08:11:38 by stevep »

Offline squizzler

  • Posts: 33
    • My blog
Re: Keyboard Layout Analyzer - new forked version
« Reply #3 on: Sun, 03 May 2020, 12:09:11 »
I wish you luck refining this programme but wonder if if there might be better code from which to start. For example, I attach a graph showing the metrics against which the layout I adopted last year, RSTHD, was developed. Link to its creator's writeup is in my signature below (from which his code is linked). Whilst I can only comment as a layperson, the apparent care that went into crafting the algorithm is borne out by my own experiences of the layout.

As somebody who has adopted a layout which puts 'E' on the thumb I obviously concur with your decision to reduce the penalty assigned to that digit. It is my expectation that with the recent availability of hobbyist hardware inspired by Maltron (*Dox, Corne, Iris, Keyboardio et. al.) layouts with thumb activated characters will enjoy a renewed interest.
 
Running RSTHD on Minidox since 2019

Offline Gorbon

  • Posts: 42
  • Location: Greece
Re: Keyboard Layout Analyzer - new forked version
« Reply #4 on: Mon, 04 May 2020, 05:01:55 »
Anyway, I have recently taken it upon myself to studying the source code of the analyzer, and documenting how its scoring system works. Not being content with that though, I then started to think of ways that it could be improved. To this end, I have now forked the original repo, and made various changes and, hopefully, improvements. There is always some degree of personal opinion and preference when it comes to layout design, so all my changes to algorithm are documented, so that people can freely evaluate them and decide if they agree or not.

Have a play around with it and let me know what you think!

Nicely done! Thanks for doing this.

I did a few rounds of testing (focused on keyboard layouts) and made some observations:
  • The scores of "QWERTY" and "QWERTY Wide-Mod" are consistently very close, I would expect there to be a more clear advantage for the wide mod.
  • On the matrix keyboard the keys don’t align with the hand approach angle, forcing both hands to twist outwards while typing. So I would expect the “Colemak-DHm Matrix” to score lower than both "Ergodox Colemak-DHm (Mod-DH)" and "Colemak-DH (Mod-DH) split-space", but that doesn’t seem to be the case. The matrix, scores very close to the Ergodox and very often higher than the ISO board with the Angle Mod.
  • Also on number input (Pi 1000), "Colemak-DH (Mod-DH) split-space" scores markedly lower than "Colemak-DH (Mod-DH)". I would expect these to be identical.
I’ve also added Maltron and RSTHD layouts for the Ergodox (attached). In most tests they seem to score close to one another, but both lower than the "Ergodox Colemak-DHm (Mod-DH)"

Finally, the "QWERTY split-space" preset doesn’t seem to load.

* Ergodox_Maltron.json
* Ergodox_RSTHD.json

Offline stevep

  • Thread Starter
  • Posts: 36
    • Colemak Mod-DH
Re: Keyboard Layout Analyzer - new forked version
« Reply #5 on: Mon, 04 May 2020, 07:43:11 »
Thanks for taking a look and giving feedback.

  • The scores of "QWERTY" and "QWERTY Wide-Mod" are consistently very close, I would expect there to be a more clear advantage for the wide mod.

Well, the calculation is largely based on the fingers used and distance moved relative to home, so because the Wide mod moves the home position, the relative movements will be the same. Obviously the greater separation has some ergonomic benefit but this is not modelled explicitly. The main difference will be down to the things like easier access to keys like Return or less load on pinky.

  • On the matrix keyboard the keys don’t align with the hand approach angle, forcing both hands to twist outwards while typing. So I would expect the “Colemak-DHm Matrix” to score lower than both "Ergodox Colemak-DHm (Mod-DH)" and "Colemak-DH (Mod-DH) split-space", but that doesn’t seem to be the case. The matrix, scores very close to the Ergodox and very often higher than the ISO board with the Angle Mod.

Dealing with hand approach angle is an outstanding problem for split keyboards like the Ergodox. Because obviously, the user can rotate each half to their preferred angle, but the algorithm currently only assumes the board is straight. I was planning to add a boolean to indicate a split board, so that the angle of approach effect can be cancelled out in such cases, but I haven't done this yet. I'm not sure why Colemak-DHm Matrix scores so well, but maybe the grid-geometry with no staggering at all helps with the distance calculation. It'll be interesting to see what happens when I've fixed the split board issue.

Edit: I have now added explicit support for split keyboards to the algorithm. As a result of this change, split boards like the Ergodox should now do a bit better.

  • Also on number input (Pi 1000), "Colemak-DH (Mod-DH) split-space" scores markedly lower than "Colemak-DH (Mod-DH)". I would expect these to be identical.
Can't reproduce this, I do get the same score for both.

I’ve also added Maltron and RSTHD layouts for the Ergodox (attached). In most tests they seem to score close to one another, but both lower than the "Ergodox Colemak-DHm (Mod-DH)"
Finally, the "QWERTY split-space" preset doesn’t seem to load.

Thanks, I have added these and also fixed QWERTY split-space.

« Last Edit: Tue, 05 May 2020, 07:22:40 by stevep »

Offline Gorbon

  • Posts: 42
  • Location: Greece
Re: Keyboard Layout Analyzer - new forked version
« Reply #6 on: Tue, 05 May 2020, 16:11:58 »
  • Also on number input (Pi 1000), "Colemak-DH (Mod-DH) split-space" scores markedly lower than "Colemak-DH (Mod-DH)". I would expect these to be identical.
Can't reproduce this, I do get the same score for both.

Yes, I should've been more specific. The problem seems to surface when comparing ISO and ANSI layouts, which shouldn't make a difference on number input. For instance the scores below for the "Pi 1000" test, are different.

Offline stevep

  • Thread Starter
  • Posts: 36
    • Colemak Mod-DH
Re: Keyboard Layout Analyzer - new forked version
« Reply #7 on: Wed, 06 May 2020, 09:25:48 »
Yes, I should've been more specific. The problem seems to surface when comparing ISO and ANSI layouts, which shouldn't make a difference on number input. For instance the scores below for the "Pi 1000" test, are different.

Ah, OK, so I think with the layouts you've selected there, the difference is in finger definitions. The DH layouts especially have angle-mod style fingering which applies to the top row also. Colemak-DH ANSI seems to be missing that though.

Looks like Dvorak may be slightly different because of the single "." character.
« Last Edit: Wed, 06 May 2020, 09:28:50 by stevep »

Offline Snarfangel

  • Posts: 288
Re: Keyboard Layout Analyzer - new forked version
« Reply #8 on: Wed, 06 May 2020, 11:18:34 »
I'm not sure if you are still accepting layouts, but here is the one I've used on my Kinesis for the past couple of years:

Offline iandoug

  • Posts: 95
Re: Keyboard Layout Analyzer - new forked version
« Reply #9 on: Wed, 12 August 2020, 16:50:38 »
  • On the matrix keyboard the keys don’t align with the hand approach angle, forcing both hands to twist outwards while typing. So I would expect the “Colemak-DHm Matrix” to score lower than both "Ergodox Colemak-DHm (Mod-DH)" and "Colemak-DH (Mod-DH) split-space", but that doesn’t seem to be the case. The matrix, scores very close to the Ergodox and very often higher than the ISO board with the Angle Mod.

The representation in KLA is not how the keyboard looks in real life. For matrix designs, they might even be split in two, but for calculation purposes, we only need to worry about how each hand moves, not how the hands relate to each other or the keyboard. So for example, Ergodox layout is shown with most keys vertical, but in reality the boards are normally twisted in ergonomic fashion.

Matrix layouts score well because all keys are 1U, unlike Ergodox. And distance travelled is usually major component of scoring system.

Cheers, Ian