From 3fc8ffbe9706908efbff7b131382fc79d18f75eb Mon Sep 17 00:00:00 2001 From: Javier Date: Wed, 20 Apr 2022 21:46:10 +0200 Subject: assume we have a wheel when using vmware, even if we can't detect it this restores wheel support when running under vmware and (unpatched) vkd --- mousetsr.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'mousetsr.c') diff --git a/mousetsr.c b/mousetsr.c index 3acbda1..c46089b 100644 --- a/mousetsr.c +++ b/mousetsr.c @@ -996,7 +996,7 @@ static void reset_mouse_hardware() data.bios_packet_size = PS2M_PACKET_SIZE_PLAIN; } } -#endif +#endif /* USE_WIN386 */ // Try to init PS/2 BIOS with desired packet size / streaming mode err = ps2m_init(data.bios_packet_size); @@ -1023,7 +1023,14 @@ static void reset_mouse_hardware() if (data.usewheel) dlog_puts("PS/2 wheel NOT detected"); data.haswheel = false; } -#endif +#if USE_VMWARE + // With the VMware backdoor, we can get the wheel information even if + // we couldn't configure the PS/2 mouse at all. + if (data.vmwavail && data.usewheel) { + data.haswheel = true; + } +#endif /* USE_VMWARE */ +#endif /* USE_WHEEL */ ps2m_set_resolution(PS2M_RESOLUTION_200); ps2m_set_sample_rate(PS2M_SAMPLE_RATE_80); -- cgit v1.2.3