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

Fix use of `position` in `no_handswitch_after_unbalancing_key` #40

Closed Glitchy-Tozier closed 2 years ago

Glitchy-Tozier commented 2 years ago

Here we assign a cost according to how far keys are located away from each other. However, in the previous implementation, the matrix_position was actually used instead of the real distance (=`position). This PR fixes this issue.


Slightly off-topic:

  1. This might be the place where the distance functions may have been useful. However, I wouldn't know where to apply them anyway, as there are two different calculations going on: (dx + dy - 3.0) and 1.0 + dy * dy.
  2. Why do we exclude_rows: [3] in movement_pattern_same_row and trigram_rolls?