Invert space bar swipe direction for RTL languages

This commit is contained in:
Helium314 2022-03-19 11:42:57 +01:00 committed by GitHub
parent e9393dfab0
commit 6c502a1f2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1393,6 +1393,10 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
@Override @Override
public void onMovePointer(int steps) { public void onMovePointer(int steps) {
// for RTL languages we want to invert pointer movement
if (mRichImm.getCurrentSubtype().isRtlSubtype())
steps = -steps;
mInputLogic.finishInput(); mInputLogic.finishInput();
if (steps < 0) { if (steps < 0) {
int availableCharacters = mInputLogic.mConnection.getTextBeforeCursor(64, 0).length(); int availableCharacters = mInputLogic.mConnection.getTextBeforeCursor(64, 0).length();