From d1c7d4097c28ee5d93fd28097474d1241dbb29aa Mon Sep 17 00:00:00 2001 From: Andy2 Date: Fri, 9 Jul 2010 18:52:14 -0700 Subject: [PATCH] remove focus-related code and declarations --- .../eehouse/android/xw4/jni/JNIThread.java | 49 ------------------- .../org/eehouse/android/xw4/jni/XwJNI.java | 2 - 2 files changed, 51 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/JNIThread.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/JNIThread.java index 34fd03bbc..24215ea62 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/JNIThread.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/JNIThread.java @@ -91,7 +91,6 @@ public class JNIThread extends Thread { private Handler m_handler; private SyncedDraw m_drawer; private static final int kMinDivWidth = 10; - private boolean m_keyDown = false; private Rect m_connsIconRect; private int m_connsIconID = 0; private boolean m_inBack = false; @@ -199,54 +198,6 @@ public class JNIThread extends Thread { boolean[] barr ) { boolean draw = false; - boolean handled = false; - boolean goingUp = JNICmd.CMD_KEYUP == cmd; - - if ( m_keyDown && !goingUp ) { - // ignore duplicate downs for now - } else { - // sometimes ups come without prior downs. Fake a down in - // that case. - if ( goingUp && !m_keyDown ) { - draw = XwJNI.board_handleKey( m_jniGamePtr, xpKey, false, barr ); - handled = barr[0]; - } - - if ( XwJNI.board_handleKey( m_jniGamePtr, xpKey, goingUp, barr ) ) { - handled = barr[0] || handled; - draw = true; - } - m_keyDown = !goingUp; - - if ( goingUp && !handled ) { - int[] order = { DrawCtx.OBJ_SCORE, - DrawCtx.OBJ_BOARD, - DrawCtx.OBJ_TRAY }; - int curType = XwJNI.board_getFocusOwner( m_jniGamePtr ); - int cur = 0; - if ( DrawCtx.OBJ_NONE != curType ) { - for ( cur = 0; cur < order.length; ++cur ) { - if ( order[cur] == curType ) { - break; - } - } - } - cur += order.length; - switch( xpKey ) { - case XP_CURSOR_KEY_DOWN: - case XP_CURSOR_KEY_RIGHT: - ++cur; - break; - case XP_CURSOR_KEY_UP: - case XP_CURSOR_KEY_LEFT: - --cur; - break; - } - cur %= order.length; - draw = XwJNI.board_focusChanged( m_jniGamePtr, order[cur] ) - || draw; - } - } return draw; } // processKeyEvent diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/XwJNI.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/XwJNI.java index 09dc0d090..b23981a44 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/XwJNI.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/jni/XwJNI.java @@ -146,8 +146,6 @@ public class XwJNI { public static native boolean board_beginTrade( int gamePtr ); public static native String board_formatRemainingTiles( int gamePtr ); - public static native int board_getFocusOwner( int gamePtr ); - public static native boolean board_focusChanged( int gamePtr, int typ ); public static native int board_visTileCount( int gamePtr ); public static native boolean board_canHint( int gamePtr ); public static native boolean board_canShuffle( int gamePtr );