author | lyra.lee <lyra.lee@amlogic.com> | 2011-08-08 10:36:39 (GMT) |
---|---|---|
committer | lyra.lee <lyra.lee@amlogic.com> | 2011-08-08 10:39:21 (GMT) |
commit | c445c943376b46fb334556e222974d50298cfa3f (patch) | |
tree | 592604f5ba0f27cddcef09d1a3481a679db09240 | |
parent | dcaf35da4268b1a6f3968dcf548f51d59f20abf1 (diff) | |
download | RemoteIME-c445c943376b46fb334556e222974d50298cfa3f.zip RemoteIME-c445c943376b46fb334556e222974d50298cfa3f.tar.gz RemoteIME-c445c943376b46fb334556e222974d50298cfa3f.tar.bz2 |
fix a bug:cannot move focus to some buttons
-rwxr-xr-x | src/com/amlogic/inputmethod/remote/SkbContainer.java | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/com/amlogic/inputmethod/remote/SkbContainer.java b/src/com/amlogic/inputmethod/remote/SkbContainer.java index b10e7ec..add073a 100755 --- a/src/com/amlogic/inputmethod/remote/SkbContainer.java +++ b/src/com/amlogic/inputmethod/remote/SkbContainer.java @@ -665,7 +665,7 @@ public class SkbContainer extends RelativeLayout implements OnTouchListener { return mSoftKeyFocus; } else if (keyCode == KeyEvent.KEYCODE_DPAD_LEFT) { - if(mSoftKeyFocus==null) + /* if(mSoftKeyFocus==null) mSoftKeyFocus=skb.getKey(0,-1); else{ int row = mSoftKeyFocus.mRow; @@ -684,10 +684,18 @@ public class SkbContainer extends RelativeLayout implements OnTouchListener { row = i; } mSoftKeyFocus = skb.getKey(row,loc); + } */ + if(mSoftKeyFocus==null) + mSoftKeyFocus=skb.getKey(0,0); + else + { + int x = mSoftKeyFocus.mLeft-skb.getKeyXMargin()-10; + int y = mSoftKeyFocus.mTop+mSoftKeyFocus.height()/2; + mSoftKeyFocus = skb.mapToKey(x,y); } } else if (keyCode == KeyEvent.KEYCODE_DPAD_RIGHT) { - if(mSoftKeyFocus==null) + /* if(mSoftKeyFocus==null) mSoftKeyFocus=skb.getKey(0,0); else{ int row = mSoftKeyFocus.mRow; @@ -705,6 +713,15 @@ public class SkbContainer extends RelativeLayout implements OnTouchListener { else mSoftKeyFocus = skb.getKey(row, loc); } + }*/ + + if(mSoftKeyFocus==null) + mSoftKeyFocus=skb.getKey(0,0); + else + { + int x = mSoftKeyFocus.mRight+skb.getKeyXMargin(); + int y = mSoftKeyFocus.mTop+mSoftKeyFocus.height()/2; + mSoftKeyFocus = skb.mapToKey(x,y); } } |