aradzie / keybr.com

The smartest way to learn touch typing and improve your typing speed.

Home Page:https://www.keybr.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Wrong depressed keys shown when using a layout other than US

kevinpastor opened this issue · comments

Description

I am using the US Colemak-DH (matrix) layout on keybr.com. When typing, the wrong keys are highlighted, i.e. shown as depressed as worded in the codebase. This problem seems to affect any layout other than US.

For the image below, I was pressing the "A", "R", "S", and "T" keys. The fourth and fifth keys on the first row are shown as depressed since "R" and "T" are located there on the US layout.

image

Detail

I've looked briefly in the codebase and the problem seems to be that keys are given the wrong data-key when using another layout than US. The following screenshot was taken with the US Colemak-DH (matrix) layout, where "A", "R", "S", and "T" are right next to each other. You can see that they are instead given the data-key of the corresponding positional key on the US layout.

image

It's my first time looking at the codebase, but I think two fixes are possible: the right data-key is passed to the Key component (packages/keybr-keyboard-ui/lib/Key.tsx), or the logic behind the update of depressedKeys in the Presenter component (packages/page-practice/lib/practice/Presenter.tsx) could be updated.

Note as this seems to be similar to #39, the problem I have is only for key highlight; the lesson registers the keys correctly.

I also noticed the same today, came here to post about it and found this issue. Agree: only the highlight effect on the on-screen keyboard is affected and the actual lesson works fine.

The linked #39 seems to focus on the use of "smart" keyboards but I think this is a general issue. I am using a plain old dumb Logitech keyboard, nothing smart about it.