Skip to content

Commit

Permalink
home_row_positions
Browse files Browse the repository at this point in the history
  • Loading branch information
Glitchy-Tozier committed May 24, 2023
1 parent da2ab4e commit 19a2b82
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion config/keyboard/chocolad.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ keyboard:
- [22, 23, 24, 25, 26, 26, 25, 24, 23, 22]
- [ 27, 28, 29, 29, 28, 27 ]

home_row_positions:
finger_resting_positions:
Left:
Pinky: [50.5, 115.5]
Ring: [100.5, 115.5]
Expand Down
2 changes: 1 addition & 1 deletion config/keyboard/crkbd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ keyboard:
- [ 21, 22, 23, 24, 25, 26, 26, 25, 24, 23, 22, 21]
- [ 27, 28, 29, 29, 28, 27 ]

home_row_positions:
finger_resting_positions:
Left:
Pinky: [50.5, 115.5]
Ring: [100.5, 115.5]
Expand Down
2 changes: 1 addition & 1 deletion config/keyboard/hgi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ keyboard:
- [22, 23, 24, 25, 25, 24, 23, 22]
- [ 28, 29, 29, 28 ]

home_row_positions:
finger_resting_positions:
Left:
Pinky: [50.5,165.5]
Ring: [100.5,155.5]
Expand Down
2 changes: 1 addition & 1 deletion config/keyboard/moonlander.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ keyboard:
- [ 23, 24, 25, 26, 27, 28, 28, 27, 26, 25, 24, 23]
- [ 29, 30, 31, 32, 33, 34, 35, 36, 37, 37, 36, 35, 34, 33, 32, 31, 30, 29]

home_row_positions:
finger_resting_positions:
Left:
Pinky: [50.5, 115.5]
Ring: [100.5, 115.5]
Expand Down
2 changes: 1 addition & 1 deletion config/keyboard/ortho.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ keyboard:
- [ 21, 22, 23, 24, 25, 26, 26, 25, 24, 23, 22, 21]
- [ 27, 28, 29, 30, 31, 32, 33, 32, 31, 30, 29, 28, 27]

home_row_positions:
finger_resting_positions:
Left:
Pinky: [50.5, 65.5]
Ring: [100.5, 65.5]
Expand Down
2 changes: 1 addition & 1 deletion config/keyboard/standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ keyboard:
- [ 24, 25, 26, 27, 28, 29, 30, 30, 29, 28, 27, 26, 24]
- [ 31, 32, 33, 34, 35, 36, 37, 38]

home_row_positions:
finger_resting_positions:
Left:
Pinky: [114.5, 125.5]
Ring: [164.5, 125.5]
Expand Down
2 changes: 1 addition & 1 deletion config/keyboard/standard_diacritics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ keyboard:
- [ 24, 25, 26, 27, 28, 29, 30, 30, 29, 28, 27, 26, 24]
- [ 31, 32, 33, 34, 35, 36, 37, 38]

home_row_positions:
finger_resting_positions:
Left:
Pinky: [114.5, 125.5]
Ring: [164.5, 125.5]
Expand Down
2 changes: 1 addition & 1 deletion config/keyboard/standard_qwerty_uk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ keyboard:
- [ 24, 25, 26, 27, 28, 29, 30, 30, 29, 28, 27, 26, 24]
- [ 31, 32, 33, 34, 35, 36, 37, 38]

home_row_positions:
finger_resting_positions:
Left:
Pinky: [114.5, 125.5]
Ring: [164.5, 125.5]
Expand Down
2 changes: 1 addition & 1 deletion config/keyboard/standard_qwerty_us.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ keyboard:
- [ 24, 26, 27, 28, 29, 30, 30, 29, 28, 27, 26, 24]
- [ 31, 32, 33, 34, 35, 36, 37, 38]

home_row_positions:
finger_resting_positions:
Left:
Pinky: [114.5, 125.5]
Ring: [164.5, 125.5]
Expand Down
8 changes: 4 additions & 4 deletions keyboard_layout/src/keyboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub type KeyIndex = u8;
pub struct Keyboard {
/// The keys of the keyboard
pub keys: Vec<Key>,
pub home_row_positions: HandFingerMap<Position>,
pub finger_resting_positions: HandFingerMap<Position>,
plot_template: String,
plot_template_short: String,
}
Expand All @@ -43,7 +43,7 @@ pub struct KeyboardYAML {
key_costs: Vec<Vec<f64>>,
symmetries: Vec<Vec<u8>>,
unbalancing_positions: Vec<Vec<Position>>,
home_row_positions: AHashMap<Hand, AHashMap<Finger, Position>>,
finger_resting_positions: AHashMap<Hand, AHashMap<Finger, Position>>,
plot_template: String,
plot_template_short: String,
}
Expand Down Expand Up @@ -126,8 +126,8 @@ impl Keyboard {

Keyboard {
keys,
home_row_positions: HandFingerMap::with_hashmap(
&k.home_row_positions,
finger_resting_positions: HandFingerMap::with_hashmap(
&k.finger_resting_positions,
Position::default(),
),
plot_template: k.plot_template,
Expand Down
6 changes: 3 additions & 3 deletions layout_evaluation/src/metrics/bigram_metrics/kla_distance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ impl BigramMetric for KLADistance {
) -> (f64, Option<String>) {
let mut finger_values: HandFingerMap<f64> = HandFingerMap::with_default(0.0);

let home_row_positions = FingerStates::with_positions(&layout.keyboard.home_row_positions);
let finger_resting_positions = FingerStates::with_positions(&layout.keyboard.finger_resting_positions);

bigrams.iter().for_each(|((prev_key, curr_key), weight)| {
// collect used fingers and keys for previous symbol
let mut prev_used_keys = home_row_positions;
let mut prev_used_keys = finger_resting_positions;
prev_used_keys.register_key(prev_key);
if !self.ignore_modifiers {
prev_key.modifiers.layerkeys().iter().for_each(|k| {
Expand All @@ -97,7 +97,7 @@ impl BigramMetric for KLADistance {
}

// collect used fingers and keys for currend symbol
let mut curr_used_keys = home_row_positions;
let mut curr_used_keys = finger_resting_positions;
curr_used_keys.register_key(curr_key);
if !self.ignore_modifiers {
curr_key.modifiers.layerkeys().iter().for_each(|k| {
Expand Down

0 comments on commit 19a2b82

Please sign in to comment.