Skip to content
Snippets Groups Projects
Commit e767ecd2 authored by Nick's avatar Nick :v:
Browse files

small input fix

parent 83451aee
No related branches found
No related tags found
No related merge requests found
......@@ -143,6 +143,7 @@ void AndroidDesktop::keyEvent(rdr::U32 keysym, __unused_attr rdr::U32 keycode, b
void AndroidDesktop::pointerEvent(const rfb::Point& pos, int buttonMask) {
if (pos.x < mDisplayRect.left || pos.x > mDisplayRect.right || pos.y < mDisplayRect.top ||
pos.y > mDisplayRect.bottom) {
ALOGV("pointer dropped x=%d y=%d left=%d right=%d top=%d bottom=%d", pos.x, pos.y, mDisplayRect.left, mDisplayRect.right, mDisplayRect.top, mDisplayRect.bottom);
// outside viewport
return;
}
......@@ -150,7 +151,7 @@ void AndroidDesktop::pointerEvent(const rfb::Point& pos, int buttonMask) {
uint32_t x = pos.x - spaceX;
uint32_t y = pos.y * ((float)(mDisplayRect.getHeight()) / (float)mPixels->height());
//ALOGV("pointer xlate x1=%d y1=%d x2=%d y2=%d", pos.x, pos.y, x, y);
ALOGV("pointer xlate x1=%d y1=%d x2=%d y2=%d", pos.x, pos.y, x, y);
mServer->setCursorPos(rfb::Point(x, y));
mInputDevice->pointerEvent(buttonMask, x, y);
......
......@@ -306,6 +306,10 @@ void InputDevice::pointerEvent(int buttonMask, int x, int y) {
inject(EV_KEY, BTN_LEFT, 0);
}
inject(EV_SYN, SYN_REPORT, 0);
} else if (mLeftClicked && touch) {
inject(EV_ABS, ABS_X, x);
inject(EV_ABS, ABS_Y, y);
inject(EV_SYN, SYN_REPORT, 0);
}
if ((buttonMask & 4) && !mRightClicked) // right btn clicked
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment