Skip to content

Commit

Permalink
Fix ROGAlly inputs (#801)
Browse files Browse the repository at this point in the history
  • Loading branch information
Valkirie authored Oct 26, 2023
1 parent 64f5a0d commit 455a73a
Showing 1 changed file with 7 additions and 33 deletions.
40 changes: 7 additions & 33 deletions HandheldCompanion/Devices/ASUS/ROGAlly.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,55 +206,29 @@ private void HandleEvent(byte key)
// get button
var button = keyMapping[key];

// HID Report Item = hex = decimal
// Left or right paddle = A5 = 165
// Left OEM key = A6 = 166
// Right OEM key = 38 = 56
// Right OEM key hold = A7 and A8 = 167 and 168

switch (key)
{
case 236:
return;

case 0:
{
KeyRelease(ButtonFlags.OEM3);
}
return;

case 56:
case 166:
{
// OEM1 and OEM2 key needs a key press delay based on emulated controller
Task.Run(async () =>
{
KeyPress(button);
await Task.Delay(KeyPressDelay);
KeyRelease(button);
});
}
break;

case 165:
case 167:
case 167: // Armory crate: Hold
KeyPress(button);
break;

case 168:
case 168: // Armory crate: Hold, released
KeyRelease(button);
break;

default:
case 56: // Armory crate: Click
case 165: // Back paddles: Click
case 166: // Command center: Click
{
Task.Run(async () =>
{
KeyPress(button);
await Task.Delay(20);
await Task.Delay(KeyPressDelay);
KeyRelease(button);
});
}
break;
}
}
}
}

0 comments on commit 455a73a

Please sign in to comment.