jackhumbert / typing_model

Home Page:https://jackhumbert.github.io/typing_model/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Redox layouts finger-key mapping differs between left and right sides of the keyboard.

bmad4ever opened this issue · comments

On the right side of the keyboard, the ring finger dominates over the pinky above the key assigned to the pinky on the home row. On the left side, the same 'mirrored' key is assigned to the pinky finger.

For consistency's sake, Redox layouts finger-key mappings should be mirrored between both halves of the keyboard.

I found the problem. The effort is the same for both fingers, the left pinky is calculated before the left ring and the right pinky is calculated and compared after the right ring finger.

The problem can be solved by changing this line:

if (temp_key.effort < keymap[key].effort) {

to:
if (temp_key.effort < keymap[key].effort || temp_key.effort == keymap[key].effort && (i>4))

But idk if there may be cases where comparing the base would yield a different and more "intuitive" finger assignments. If there are, the following solution may be preferable:

       if (temp_key.effort == keymap[key].effort)
       {
          if (temp_key.base < keymap[key].base || temp_key.base == keymap[key].base && (i>4) ) {
          keymap[key] = {...keymap[key], ...temp_key};
          }
       }
       else if (temp_key.effort < keymap[key].effort) {
          keymap[key] = {...keymap[key], ...temp_key};
       }