mirror of
https://github.com/jamessanford/kegs.git
synced 2025-01-04 18:30:59 +00:00
Use 'TouchMouse' instead of old KegsTouch name.
This commit is contained in:
parent
2726b3f2c7
commit
cddd41ca6c
@ -43,8 +43,8 @@ public class KegsMain extends SherlockFragmentActivity implements KegsKeyboard.S
|
||||
private KegsThread mKegsThread;
|
||||
|
||||
protected KegsViewGL mKegsView;
|
||||
private KegsTouch mKegsTouch;
|
||||
private KegsKeyboard mKegsKeyboard;
|
||||
private TouchMouse mTouchMouse;
|
||||
private TouchJoystick mJoystick;
|
||||
|
||||
private boolean mModeMouse = true;
|
||||
@ -392,7 +392,7 @@ public class KegsMain extends SherlockFragmentActivity implements KegsKeyboard.S
|
||||
mKegsView.updateScreenSize(bitmapSize);
|
||||
|
||||
// Update scale of mouse movements.
|
||||
mKegsTouch.updateScale(bitmapSize.getScaleX(), bitmapSize.getScaleY());
|
||||
mTouchMouse.updateScale(bitmapSize.getScaleX(), bitmapSize.getScaleY());
|
||||
|
||||
// Update special click zone that toggles the ActionBar.
|
||||
final TouchSpecialZone zone = new TouchSpecialZone(getSpecialActionBarRect(bitmapSize)) {
|
||||
@ -401,7 +401,7 @@ public class KegsMain extends SherlockFragmentActivity implements KegsKeyboard.S
|
||||
updateActionBar(mOverrideActionBar);
|
||||
}
|
||||
};
|
||||
mKegsTouch.setSpecialZone(zone);
|
||||
mTouchMouse.setSpecialZone(zone);
|
||||
mJoystick.setSpecialZone(zone);
|
||||
|
||||
// Force another redraw of the bitmap into the canvas. Bug workaround.
|
||||
@ -535,7 +535,7 @@ public class KegsMain extends SherlockFragmentActivity implements KegsKeyboard.S
|
||||
mKegsView.getBitmap());
|
||||
mKegsThread.registerUpdateScreenInterface(mKegsView);
|
||||
|
||||
mKegsTouch = new KegsTouch(this, getThread().getEventQueue());
|
||||
mTouchMouse = new TouchMouse(this, getThread().getEventQueue());
|
||||
mJoystick = new TouchJoystick(getThread().getEventQueue());
|
||||
|
||||
final SpecialRelativeLayout mainView = (SpecialRelativeLayout)findViewById(R.id.mainview);
|
||||
@ -545,7 +545,7 @@ public class KegsMain extends SherlockFragmentActivity implements KegsKeyboard.S
|
||||
public boolean onTouch(View v, MotionEvent event) {
|
||||
// TODO: consider using two listeners and setOnTouchListener them
|
||||
if (mModeMouse) {
|
||||
return mKegsTouch.onTouchEvent(event);
|
||||
return mTouchMouse.onTouchEvent(event);
|
||||
} else {
|
||||
return mJoystick.onTouchEvent(event);
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
|
||||
// Translate onTouchEvent calls into mouse pointer movement.
|
||||
|
||||
class KegsTouch {
|
||||
class TouchMouse {
|
||||
private ConcurrentLinkedQueue mEventQueue;
|
||||
private int mButton1 = 0;
|
||||
private int mTouchSlopSquare;
|
||||
@ -37,7 +37,7 @@ class KegsTouch {
|
||||
|
||||
private TouchSpecialZone mSpecialZone = null;
|
||||
|
||||
public KegsTouch(Context context, ConcurrentLinkedQueue q) {
|
||||
public TouchMouse(Context context, ConcurrentLinkedQueue q) {
|
||||
mEventQueue = q;
|
||||
|
||||
final ViewConfiguration configuration = ViewConfiguration.get(context);
|
Loading…
Reference in New Issue
Block a user