am 69db35c4: Make the buttons work for edge pixels of the keyboard

* commit '69db35c493aa3a6a9f17094bf2180a52ffb2358e':
  Make the buttons work for edge pixels of the keyboard
main
Ken Wakasa 2010-10-29 08:16:46 -07:00 committed by Android Git Automerger
commit b5e8c77997
2 changed files with 4 additions and 2 deletions

View File

@ -797,7 +797,9 @@ public class LatinKeyboard extends Keyboard {
if (mCurrentlyInSpace) {
return new int[] { mSpaceKeyIndex };
} else {
return super.getNearestKeys(x, y);
// Avoid dead pixels at edges of the keyboard
return super.getNearestKeys(Math.max(0, Math.min(x, getMinWidth() - 1)),
Math.max(0, Math.min(y, getHeight() - 1)));
}
}

View File

@ -83,4 +83,4 @@ class ProximityKeyDetector extends KeyDetector {
}
return primaryIndex;
}
}
}