Skip to content

Commit 56d3ff4

Browse files
committed
Fixed a bug when some keyboard's change layout button doesn't work as expected
1 parent 09bc110 commit 56d3ff4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/src/main/kotlin/com/simplemobiletools/keyboard/views/MyKeyboardView.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1390,12 +1390,15 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
13901390
}
13911391
showPreview(NOT_A_KEY)
13921392
Arrays.fill(mKeyIndices, NOT_A_KEY)
1393+
1394+
val currentKeyCode = mKeys.getOrNull(mCurrentKey)?.code
1395+
13931396
// If we're not on a repeating key (which sends on a DOWN event)
13941397
if (mRepeatKeyIndex == NOT_A_KEY && !mMiniKeyboardOnScreen && !mAbortKey) {
13951398
detectAndSendKey(mCurrentKey, touchX, touchY, eventTime)
13961399
}
13971400

1398-
if (mKeys.getOrNull(mCurrentKey)?.code == KEYCODE_SPACE && !mIsLongPressingSpace) {
1401+
if (currentKeyCode == KEYCODE_SPACE && !mIsLongPressingSpace) {
13991402
detectAndSendKey(mCurrentKey, touchX, touchY, eventTime)
14001403
}
14011404

0 commit comments

Comments
 (0)