mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-19 07:30:53 +00:00
merge labelFlags when when replacing comma & period
so e.g. dvorak z key doesn't get .com popup hint by default
This commit is contained in:
parent
11f45a6209
commit
e21168b1d3
1 changed files with 4 additions and 2 deletions
|
@ -229,13 +229,15 @@ class KeyboardParser(private val params: KeyboardParams, private val context: Co
|
||||||
return
|
return
|
||||||
// replace comma / period if 2 keys in normal bottom row
|
// replace comma / period if 2 keys in normal bottom row
|
||||||
if (baseKeys.last().size == 2) {
|
if (baseKeys.last().size == 2) {
|
||||||
|
val newComma = baseKeys.last()[0]
|
||||||
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) }
|
{ newComma.copy(newGroupId = 1, newType = newComma.type, newLabelFlags = it.labelFlags or newComma.labelFlags) }
|
||||||
)
|
)
|
||||||
|
val newPeriod = baseKeys.last()[1]
|
||||||
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) }
|
{ newPeriod.copy(newGroupId = 2, newType = newPeriod.type, newLabelFlags = it.labelFlags or newPeriod.labelFlags) }
|
||||||
)
|
)
|
||||||
baseKeys.removeAt(baseKeys.lastIndex)
|
baseKeys.removeAt(baseKeys.lastIndex)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue