remove the fallback to original key type when replacing comma & period

relevant e.g. for dvorak in url fields, where otherwise the q has functional key background
This commit is contained in:
Helium314 2025-06-08 11:07:51 +02:00
parent 5cd184e5c2
commit 896e207c5f

View file

@ -231,11 +231,11 @@ class KeyboardParser(private val params: KeyboardParams, private val context: Co
if (baseKeys.last().size == 2) { if (baseKeys.last().size == 2) {
functionalKeysBottom.replaceFirst( functionalKeysBottom.replaceFirst(
{ it.label == KeyLabel.COMMA || it.groupId == KeyData.GROUP_COMMA}, { it.label == KeyLabel.COMMA || it.groupId == KeyData.GROUP_COMMA},
{ baseKeys.last()[0].copy(newGroupId = 1, newType = baseKeys.last()[0].type ?: it.type) } { baseKeys.last()[0].copy(newGroupId = 1, newType = baseKeys.last()[0].type) }
) )
functionalKeysBottom.replaceFirst( functionalKeysBottom.replaceFirst(
{ it.label == KeyLabel.PERIOD || it.groupId == KeyData.GROUP_PERIOD}, { it.label == KeyLabel.PERIOD || it.groupId == KeyData.GROUP_PERIOD},
{ baseKeys.last()[1].copy(newGroupId = 2, newType = baseKeys.last()[1].type ?: it.type) } { baseKeys.last()[1].copy(newGroupId = 2, newType = baseKeys.last()[1].type) }
) )
baseKeys.removeAt(baseKeys.lastIndex) baseKeys.removeAt(baseKeys.lastIndex)
} }