mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 01:00:29 +08:00
pikvm/pikvm#1437: Don't reset absolute mouse position on clear
This commit is contained in:
parent
2649a2fa01
commit
adbd4f242b
@ -53,7 +53,7 @@ static u8 _kbd_keys[6] = {0};
|
|||||||
static u8 _mouse_buttons = 0;
|
static u8 _mouse_buttons = 0;
|
||||||
static s16 _mouse_abs_x = 0;
|
static s16 _mouse_abs_x = 0;
|
||||||
static s16 _mouse_abs_y = 0;
|
static s16 _mouse_abs_y = 0;
|
||||||
#define _MOUSE_CLEAR { _mouse_buttons = 0; _mouse_abs_x = 0; _mouse_abs_y = 0; }
|
#define _MOUSE_CLEAR { _mouse_buttons = 0; }
|
||||||
|
|
||||||
|
|
||||||
static void _kbd_sync_report(bool new);
|
static void _kbd_sync_report(bool new);
|
||||||
@ -193,7 +193,7 @@ void ph_usb_send_clear(void) {
|
|||||||
if (PH_O_IS_MOUSE_USB) {
|
if (PH_O_IS_MOUSE_USB) {
|
||||||
_MOUSE_CLEAR;
|
_MOUSE_CLEAR;
|
||||||
if (PH_O_IS_MOUSE_USB_ABS) {
|
if (PH_O_IS_MOUSE_USB_ABS) {
|
||||||
_mouse_abs_send_report(0, 0);
|
_mouse_abs_send_report(_mouse_abs_x, _mouse_abs_y);
|
||||||
} else { // PH_O_IS_MOUSE_USB_REL
|
} else { // PH_O_IS_MOUSE_USB_REL
|
||||||
_mouse_rel_send_report(0, 0, 0, 0);
|
_mouse_rel_send_report(0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -153,7 +153,6 @@ class MouseProcess(BaseDeviceProcess):
|
|||||||
move_x = self.__x
|
move_x = self.__x
|
||||||
move_y = self.__y
|
move_y = self.__y
|
||||||
else:
|
else:
|
||||||
assert self.__x == self.__y == 0
|
|
||||||
if relative_event is not None:
|
if relative_event is not None:
|
||||||
move_x = relative_event.delta_x
|
move_x = relative_event.delta_x
|
||||||
move_y = relative_event.delta_y
|
move_y = relative_event.delta_y
|
||||||
@ -177,5 +176,3 @@ class MouseProcess(BaseDeviceProcess):
|
|||||||
|
|
||||||
def __clear_state(self) -> None:
|
def __clear_state(self) -> None:
|
||||||
self.__pressed_buttons = 0
|
self.__pressed_buttons = 0
|
||||||
self.__x = 0
|
|
||||||
self.__y = 0
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user