Add Mouse Wheel Scroll Events
This commit add support for mouse wheel scroll events in KVM.
It supports for mouse scroll up/down buttons, by which user can use
mouse wheel functionality.
Testing:
Tested mouse wheel functionality.
Verified mouse wheel scroll up/down functions.
Signed-off-by: Tejas Patil <tejaspp@ami.com>
Change-Id: I7f53f0f203a81b55f2377982571e8f415ed99df2
diff --git a/ikvm_input.cpp b/ikvm_input.cpp
index 6e8ab26..cbbfdc4 100644
--- a/ikvm_input.cpp
+++ b/ikvm_input.cpp
@@ -213,8 +213,24 @@
return;
}
- input->pointerReport[0] = ((buttonMask & 0x4) >> 1) |
- ((buttonMask & 0x2) << 1) | (buttonMask & 0x1);
+ if (buttonMask > 4)
+ {
+ input->pointerReport[0] = 0;
+ if (buttonMask == 8)
+ {
+ input->pointerReport[5] = 1;
+ }
+ else if (buttonMask == 16)
+ {
+ input->pointerReport[5] = 0xff;
+ }
+ }
+ else
+ {
+ input->pointerReport[0] = ((buttonMask & 0x4) >> 1) |
+ ((buttonMask & 0x2) << 1) | (buttonMask & 0x1);
+ input->pointerReport[5] = 0;
+ }
if (x >= 0 && (unsigned int)x < video.getWidth())
{