Update mouse drivers

This commit is contained in:
Alex 2023-03-02 02:19:35 +02:00
parent 20fa9fdc2f
commit a274109924
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD
2 changed files with 6 additions and 5 deletions

View File

@ -15,6 +15,8 @@ __attribute__((section(".extended"))) FexExtended ExtendedHeader = {
.Driver = { .Driver = {
.Name = "VMware Virtual Mouse Driver", .Name = "VMware Virtual Mouse Driver",
.Type = FexDriverType_Input, .Type = FexDriverType_Input,
.TypeFlags = FexDriverInputTypes_Mouse,
.OverrideOnConflict = true,
.Callback = CallbackHandler, .Callback = CallbackHandler,
.Bind = { .Bind = {
.Type = BIND_INTERRUPT, .Type = BIND_INTERRUPT,
@ -89,9 +91,6 @@ bool IsVMwareBackdoorAvailable(void)
int DriverEntry(void *Data) int DriverEntry(void *Data)
{ {
/* There's a bug somewhere in driver or kernel and it's just crashing. */
return NOT_IMPLEMENTED;
if (!Data) if (!Data)
return INVALID_KERNEL_API; return INVALID_KERNEL_API;
KAPI = (KernelAPI *)Data; KAPI = (KernelAPI *)Data;
@ -217,8 +216,8 @@ int CallbackHandler(KernelCallback *Data)
} }
case FetchReason: case FetchReason:
{ {
Data->InputCallback.Mouse.X = MouseX; Data->InputCallback.Mouse.X = (MouseX * KAPI->Display.GetWidth()) / 0xFFFF;
Data->InputCallback.Mouse.Y = MouseY; Data->InputCallback.Mouse.Y = (MouseY * KAPI->Display.GetHeight()) / 0xFFFF;
Data->InputCallback.Mouse.Z = MouseZ; Data->InputCallback.Mouse.Z = MouseZ;
Data->InputCallback.Mouse.Buttons.Left = MouseButton & 0x20; Data->InputCallback.Mouse.Buttons.Left = MouseButton & 0x20;
Data->InputCallback.Mouse.Buttons.Right = MouseButton & 0x10; Data->InputCallback.Mouse.Buttons.Right = MouseButton & 0x10;

View File

@ -15,6 +15,8 @@ __attribute__((section(".extended"))) FexExtended ExtendedHeader = {
.Driver = { .Driver = {
.Name = "VMware Virtual Mouse Driver", .Name = "VMware Virtual Mouse Driver",
.Type = FexDriverType_Input, .Type = FexDriverType_Input,
.TypeFlags = FexDriverInputTypes_Mouse,
.OverrideOnConflict = true,
.Callback = CallbackHandler, .Callback = CallbackHandler,
.Bind = { .Bind = {
.Type = BIND_PCI, .Type = BIND_PCI,