dariogoetz / keyboard_layout_optimizer

A keyboard layout optimizer supporting multiple layers. Implemented in Rust.
https://dariogoetz.github.io/keyboard_layout_optimizer/
GNU General Public License v3.0
86 stars 13 forks source link

Improve `asymmetric_keys`-metric #22

Closed Glitchy-Tozier closed 2 years ago

Glitchy-Tozier commented 2 years ago

I started thinking about this when I saw you removed ["gbd", "kpt"] from the metric. On one hand I think those letters are related and thus should be grouped with each other. On the other hand I understand that it is unnecessary to have bp be in the same relative positions as gk. With those non-diacritics-letters I'd actually expect them to be in "related positions". Thus I propose improving the evaluation of similar letters:

1. Related position

This metric checks whether the specified letters are in sensible related positions. Something like this:

similar_letters:
  - ["aä"]
  - ["oö"]
  - ["uü"]
  - ["gk"]
  - ["pb"]
  - ["dt"]
  - ["mn"]

2. Position-groups

This is the same as what the current metric does, according to my understanding. Symbols of specified groups shall have the same relative location to each others.

similar_letter_groups:
  - ["auo", "äüö"]

This change allows us to

  1. Make sure similar letters are in related positions to each other. This also is an important improvement to aä oö uü and also allows us to improve placements of gk pb dt mn without blocking too many of the other metrics.
  2. Still make sure aou äöü are grouped in clusters.
dariogoetz commented 2 years ago

If I understand you correctly, it would lead to a somewhat stricter, but also more intuitive placing of "similar" letters. I like the idea.

If it es possible to add this functionality on top of the existing one and make the "addition" configurable, I would be happy about a corresponding pull request.

Glitchy-Tozier commented 2 years ago

If I understand you correctly, it would lead to a somewhat stricter, but also more intuitive placing of "similar" letters. I like the idea.

That's what I was aiming for. :)

I can work on implementing this.

  1. What is your opinion on that thought, as an addition besides pure symmetry: "by similar positions, I mean something like k&g in KOY"
  2. Could you give me a quick run-down on what things you think I should know to implement this as well (and as easily) as possible? I've not touched evaluation at all, so far, which is why that part of the project seems very chaotic to me.
dariogoetz commented 2 years ago

I can work on implementing this.

1. What is your opinion on that thought, as an addition besides pure symmetry: "_by similar positions, I mean something like [k&g in KOY](https://dl.neo-layout.org/grafik/bilder-einzeln/flat/koy-1-tkl.path.svg)_"

I would rather see k and ß in koy as symmetric (different hands, same fingers)

2. Could you give me a quick run-down on what things you think I should know to implement this as well (and as easily) as possible? I've not touched evaluation at all, so far, which is why that part of the project seems very chaotic to me.

This will probably belong to the asymmetric_keys layout metric that you can find here: layout_evaluation/src/metrics/layout_metrics/asymmetric_keys.rs. The Parameters struct is represented in the as a corresponing section in the evaluation_config.yml. So if additional configuration is needed, add it there.

The interface of the metrics is defined as the LayoutMetric trait in layout_evaluation/src/metrics/layout_metrics.rs.

Glitchy-Tozier commented 2 years ago

I would rather see k and ß in koy as symmetric (different hands, same fingers)

I didn't mean I was planning to replace the symmetry-metric. It's difinitely not ideal, but wouldn't you agree that this is a step-up from random placement?

This will probably belong to the asymmetric_keys layout metric that you can find here: layout_evaluation/src/metrics/layout_metrics/asymmetric_keys.rs. The Parameters struct is represented in the as a corresponing section in the evaluation_config.yml. So if additional configuration is needed, add it there.

The interface of the metrics is defined as the LayoutMetric trait in layout_evaluation/src/metrics/layout_metrics.rs.

Thank you, I'll start working on this sometime the next ~days~ weeks.

dariogoetz commented 2 years ago

I would rather see k and ß in koy as symmetric (different hands, same fingers)

I didn't mean I was planning to replace the symmetry-metric. It's difinitely not ideal, but wouldn't you agree that this is a step-up from random placement?

I am not sure about it being a step-up. I would prefer an "unconstrained" placement that leaves the optimization more room to address the other metrics than a non-intuitive placement.

This will probably belong to the asymmetric_keys layout metric that you can find here: layout_evaluation/src/metrics/layout_metrics/asymmetric_keys.rs. The Parameters struct is represented in the as a corresponing section in the evaluation_config.yml. So if additional configuration is needed, add it there. The interface of the metrics is defined as the LayoutMetric trait in layout_evaluation/src/metrics/layout_metrics.rs.

Thank you, I'll start working on this sometime the next days.

Glitchy-Tozier commented 2 years ago

Ok, I'll skip on that thought for now!