You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The collections passed to countMatches (ansi, iso_jis, etc.) are read-only variables imported from ./modules/keycodes/###. Consequently, these keycode collections are not localized at all causing incorrect match counts to be reported.
For example, if I search for "ß" with the German OS layout, the ß key will be highlighted but the count in both ANSI and ISO tabs will be "(0)". Same story if I search for "Y" with the German OS layout; DE_Y and KC_Y (=DE_Z) are both highlighted but the ANSI tab will only report a single match because it successfully finds a "Y" in the uppercase version of KC_Y's name but KC_Z aka DE_Y has "Z" as its name in the ansi variable so the countMatches does not count it.
Current:
Expected:
(All those matches for ß in other tabs comes from the fact that "ß".toUpperCase() == "SS" but whether or not matching the TO(layer) key with a "ß" query is the expected behavior because its tooltip says "Turn on layer when preSSed" is up for debate...)
The solution would be to map the toLocalKeycode on each collection before passing it to the countMatches.
As a quick proof-of-concept, I came up with the following diff to produce the "Expected" screenshots linked above:
However, doing the mapping inside the setSearchFilter callback is probably a bad idea as that would imply doing a relatively long operation on every key event in the keycode picker search bar.
Additional Context?
No response
The text was updated successfully, but these errors were encountered:
Describe the Bug
src/store/keycodes.js
The collections passed to
countMatches
(ansi
,iso_jis
, etc.) are read-only variables imported from./modules/keycodes/###
. Consequently, these keycode collections are not localized at all causing incorrect match counts to be reported.For example, if I search for "ß" with the German OS layout, the ß key will be highlighted but the count in both ANSI and ISO tabs will be "(0)". Same story if I search for "Y" with the German OS layout; DE_Y and KC_Y (=DE_Z) are both highlighted but the ANSI tab will only report a single match because it successfully finds a "Y" in the uppercase version of KC_Y's name but KC_Z aka DE_Y has "Z" as its name in the
ansi
variable so thecountMatches
does not count it.Current:
Expected:
(All those matches for ß in other tabs comes from the fact that
"ß".toUpperCase() == "SS"
but whether or not matching theTO(layer)
key with a "ß" query is the expected behavior because its tooltip says "Turn on layer when preSSed" is up for debate...)The solution would be to map the
toLocalKeycode
on each collection before passing it to thecountMatches
.As a quick proof-of-concept, I came up with the following diff to produce the "Expected" screenshots linked above:
However, doing the mapping inside the
setSearchFilter
callback is probably a bad idea as that would imply doing a relatively long operation on every key event in the keycode picker search bar.Additional Context?
No response
The text was updated successfully, but these errors were encountered: