import org.eclipse.swt.SWT;
import org.tizen.emulator.skin.config.EmulatorConfig;
-import org.tizen.emulator.skin.config.EmulatorConfig.ArgsConstants;
import org.tizen.emulator.skin.exception.ScreenShotException;
import org.tizen.emulator.skin.image.ImageRegistry.IconName;
import org.tizen.emulator.skin.info.SkinInformation;
@Override
public void displayOn() {
- logger.info("display on");
- if (super.config.getArgBoolean(ArgsConstants.INPUT_MOUSE, false) == true)
- super.isDisplayOn = true;
+ super.displayOn();
}
@Override
public void displayOff() {
- logger.info("display off");
- if (super.config.getArgBoolean(ArgsConstants.INPUT_MOUSE, false) == true)
- super.isDisplayOn = false;
+ super.displayOff();
}
@Override
@Override
public void displayOn() {
- logger.info("display on");
- if (super.config.getArgBoolean(ArgsConstants.INPUT_MOUSE, false) == true)
- super.isDisplayOn = true;
-
-// if (pollThread.isAlive()) {
-// pollThread.setWaitIntervalTime(30);
-//
-// synchronized(pollThread) {
-// pollThread.notify();
-// }
-// }
+ super.displayOn();
}
@Override
public void displayOff() {
- logger.info("display off");
- if (super.config.getArgBoolean(ArgsConstants.INPUT_MOUSE, false) == true)
- super.isDisplayOn = false;
-
-// if (pollThread.isAlive()) {
-// pollThread.setWaitIntervalTime(0);
-//
-// shell.getDisplay().asyncExec(new Runnable() {
-// @Override
-// public void run() {
-// lcdCanvas.redraw();
-// }
-// });
-// }
+ super.displayOff();
+
+ /*if (pollThread.isAlive()) {
+ pollThread.setWaitIntervalTime(0);
+
+ shell.getDisplay().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ lcdCanvas.redraw();
+ }
+ });
+ }*/
}
/* mouse event */
protected EmulatorSkinState currentState;
- private boolean isDisplayDragging;
- private boolean isShutdownRequested;
+ protected boolean isDisplayDragging;
+ protected boolean isShutdownRequested;
private boolean isAboutToReopen;
public boolean isOnTop;
public boolean isKeyWindow;
}
protected void displayOn() {
- /* abstract */
+ logger.info("display on");
+
+ if (config.getArgBoolean(ArgsConstants.INPUT_MOUSE, false) == true) {
+ isDisplayOn = true;
+ }
}
protected void displayOff() {
- /* abstract */
+ logger.info("display off");
+
+ if (config.getArgBoolean(ArgsConstants.INPUT_MOUSE, false) == true) {
+ isDisplayOn = false;
+ }
+
+ if (isDisplayDragging == true) {
+ logger.info("auto release : mouseEvent");
+ MouseEventData mouseEventData = new MouseEventData(
+ 0, MouseEventType.RELEASE.value(),
+ 0, 0, 0, 0, 0);
+
+ communicator.sendToQEMU(
+ SendCommand.SEND_MOUSE_EVENT, mouseEventData, false);
+ }
}
/* for popup menu */
int origin_x, int origin_y, int x, int y, int z)
{
if (brightness_off) {
- TRACE("reject mouse touch in lcd off = button:%d, type:%d, x:%d, y:%d, z:%d\n",
- button_type, event_type, x, y, z);
- return;
+ if (button_type == 0) {
+ INFO("auto mouse release\n");
+ kbd_mouse_event(0, 0, 0, 0);
+
+ return;
+ } else {
+ TRACE("reject mouse touch in display off : "
+ "button=%d, type=%d, x=%d, y=%d, z=%d\n",
+ button_type, event_type, x, y, z);
+ return;
+ }
}
- TRACE("mouse_event button:%d, type:%d, host:(%d, %d), x:%d, y:%d, z:%d\n",
+ TRACE("mouse event : button=%d, type=%d, "
+ "host=(%d, %d), x=%d, y=%d, z=%d\n",
button_type, event_type, origin_x, origin_y, x, y, z);
#ifndef CONFIG_USE_SHM
pressing_origin_y = origin_y;
kbd_mouse_event(x, y, z, 1);
- TRACE("mouse_event event_type:%d, origin:(%d, %d), x:%d, y:%d, z:%d\n\n",
- event_type, origin_x, origin_y, x, y, z);
+
break;
case MOUSE_UP:
guest_x = x;
pressing_origin_x = pressing_origin_y = -1;
kbd_mouse_event(x, y, z, 0);
- TRACE("mouse_event event_type:%d, origin:(%d, %d), x:%d, y:%d, z:%d\n\n",
- event_type, origin_x, origin_y, x, y, z);
+
break;
case MOUSE_WHEELUP:
case MOUSE_WHEELDOWN:
}
kbd_mouse_event(x, y, -z, event_type);
- TRACE("mouse_event event_type:%d, origin:(%d, %d), x:%d, y:%d, z:%d\n\n",
- event_type, origin_x, origin_y, x, y, z);
+
break;
case MOUSE_MOVE:
guest_x = x;
guest_y = y;
kbd_mouse_event(x, y, z, event_type);
- TRACE("mouse_event event_type:%d, origin:(%d, %d), x:%d, y:%d, z:%d\n\n",
- event_type, origin_x, origin_y, x, y, z);
+
break;
default:
ERR("undefined mouse event type passed:%d\n", event_type);