Split mouse handling code into several small functions, removed 'tiny' screen size

This commit is contained in:
Sergii Pylypenko
2014-02-22 01:14:55 +02:00
parent 17b738f8a5
commit 4383b9d5fb
7 changed files with 302 additions and 364 deletions

View File

@@ -85,8 +85,10 @@ class Mouse
public static final int ZOOM_NONE = 0;
public static final int ZOOM_MAGNIFIER = 1;
public static final int ZOOM_SCREEN_TRANSFORM = 2;
public static final int ZOOM_FULLSCREEN_MAGNIFIER = 3;
public static final int MOUSE_HW_INPUT_FINGER = 0;
public static final int MOUSE_HW_INPUT_STYLUS = 1;
public static final int MOUSE_HW_INPUT_MOUSE = 2;
}
abstract class DifferentTouchInput
@@ -329,8 +331,8 @@ abstract class DifferentTouchInput
}
public void process(final MotionEvent event)
{
int hwMouseEvent = (event.getSource() & InputDevice.SOURCE_MOUSE) == InputDevice.SOURCE_MOUSE ? 2 :
(event.getSource() & InputDevice.SOURCE_STYLUS) == InputDevice.SOURCE_STYLUS ? 1 : 0;
int hwMouseEvent = (event.getSource() & InputDevice.SOURCE_MOUSE) == InputDevice.SOURCE_MOUSE ? Mouse.MOUSE_HW_INPUT_MOUSE :
(event.getSource() & InputDevice.SOURCE_STYLUS) == InputDevice.SOURCE_STYLUS ? Mouse.MOUSE_HW_INPUT_STYLUS : Mouse.MOUSE_HW_INPUT_FINGER;
if( ExternalMouseDetected != hwMouseEvent )
{
ExternalMouseDetected = hwMouseEvent;