Skip to content

Commit c31b267

Browse files
author
Klaus Weidner
committed
Disable vertical correction
Touching the top edges of keys erroneously triggered the key above. Disabling the vertical correction seems to fix that.
1 parent 4861568 commit c31b267

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

‎app/src/main/java/org/pocketworkstation/pckeyboard/KeyDetector.java‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package org.pocketworkstation.pckeyboard;
1818

19+
import android.util.Log;
20+
1921
import org.pocketworkstation.pckeyboard.Keyboard.Key;
2022

2123
import java.util.Arrays;
@@ -35,6 +37,7 @@ abstract class KeyDetector {
3537
protected int mProximityThresholdSquare;
3638

3739
public Key[] setKeyboard(Keyboard keyboard, float correctionX, float correctionY) {
40+
Log.i("KeyDetector", "KeyDetector correctionX=" + correctionX + " correctionY=" + correctionY);
3841
if (keyboard == null)
3942
throw new NullPointerException();
4043
mCorrectionX = (int)correctionX;

‎app/src/main/java/org/pocketworkstation/pckeyboard/LatinKeyboardBaseView.java‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -669,8 +669,9 @@ public void setKeyboard(Keyboard keyboard) {
669669
mHandler.cancelKeyTimers();
670670
mHandler.cancelPopupPreview();
671671
mKeyboard = keyboard;
672-
mKeys = mKeyDetector.setKeyboard(keyboard, -getPaddingLeft(),
673-
-getPaddingTop() + mVerticalCorrection);
672+
// Disable correctionX and correctionY, it doesn't seem to work as intended.
673+
// mKeys = mKeyDetector.setKeyboard(keyboard, -getPaddingLeft(),-getPaddingTop() + mVerticalCorrection);
674+
mKeys = mKeyDetector.setKeyboard(keyboard, 0, 0);
674675
mKeyboardVerticalGap = (int)getResources().getDimension(R.dimen.key_bottom_gap);
675676
for (PointerTracker tracker : mPointerTrackers) {
676677
tracker.setKeyboard(mKeys, mKeyHysteresisDistance);

0 commit comments

Comments
 (0)