diff options
| author | Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com> | 2019-03-19 10:20:27 -0700 |
|---|---|---|
| committer | Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com> | 2019-03-19 19:26:38 +0000 |
| commit | 3389098ff34aec7308df808266b67e66ee1e3fbc (patch) | |
| tree | d2f9c4b9327513bd59ed25aef04c29414c65ef75 | |
| parent | 2bc661d34abd1fda92a9d2b256ed88ca0e90d09a (diff) | |
| download | obmc-ikvm-3389098ff34aec7308df808266b67e66ee1e3fbc.tar.gz obmc-ikvm-3389098ff34aec7308df808266b67e66ee1e3fbc.zip | |
Fix mouse button mapping issue
Mapping of a mouse button event delivered from libvncserver is
different from HID gadget driver so this patch swaps bit position 1
and 2 to map center and right button correctly.
Tested: KVM mouse buttons worked correctly.
Change-Id: Ia1771df6763b906b5cff3041df9095e0c72c892b
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
| -rw-r--r-- | ikvm_input.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ikvm_input.cpp b/ikvm_input.cpp index 71e5b7f..fbe917b 100644 --- a/ikvm_input.cpp +++ b/ikvm_input.cpp @@ -134,7 +134,8 @@ void Input::pointerEvent(int buttonMask, int x, int y, rfbClientPtr cl) Server* server = (Server*)cl->screen->screenData; const Video& video = server->getVideo(); - input->pointerReport[0] = buttonMask & 0xFF; + input->pointerReport[0] = ((buttonMask & 0x4) >> 1) | + ((buttonMask & 0x2) << 1) | (buttonMask & 0x1); if (x >= 0 && (unsigned int)x < video.getWidth()) { |

