Fix long press behavior of akye that has altCode defined

This issue has been introduced by I2bd4daf2

Change-Id: Ie10b3e0bb360986597a0f5a8e5b8253400f924c4
main
Tadashi G. Takaoka 2012-03-02 21:29:51 +09:00
parent 13057e7c05
commit 508ded5827
1 changed files with 5 additions and 2 deletions

View File

@ -481,8 +481,11 @@ public class LatinKeyboardView extends KeyboardView implements PointerTracker.Ke
*/
protected boolean onLongPress(Key parentKey, PointerTracker tracker) {
final int primaryCode = parentKey.mCode;
if (parentKey.mAltCode != Keyboard.CODE_UNSPECIFIED) {
// Long press on a key that has altCode defined.
if (parentKey.mMoreKeys == null && !parentKey.altCodeWhileTyping()
&& parentKey.mAltCode != Keyboard.CODE_UNSPECIFIED) {
// Long press on a key that has no more keys and not altCodeWhileTyping but altCode
// defined, such as "0 +" key on phone layout and "/ :" key on datetime
// layout.
tracker.onLongPressed();
invokeCodeInput(parentKey.mAltCode);
invokeReleaseKey(primaryCode);