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

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

View File

@ -715,7 +715,9 @@ public class LatinKeyboard extends BaseKeyboard {
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;
}
}
}