A small .NET library to intercept controls on PS4 Remote Play for Windows, powered by EasyHook. The library can be used to automate any PS4 game. See the prototype demo.
Also check out PS4 Macro repository for a ready-to-use software built on this library.
Install-Package PS4RemotePlayInterceptor
Add reference to PS4RemotePlayInterceptor.dll.
This console application will hold the X button while moving the left analog stick upwards until interrupted by a keypress.
using PS4RemotePlayInterceptor;
class Program
{
static void Main(string[] args)
{
// Setup callback to interceptor
Interceptor.Callback = new InterceptionDelegate(OnReceiveData);
// Start watchdog to automatically inject when possible
Interceptor.Watchdog.Start();
// Or inject manually and handle exceptions yourself
// Interceptor.Inject();
Console.ReadKey();
}
private static void OnReceiveData(ref DualShockState state)
{
/* -- Modify the controller state here -- */
// Force press X
state.Cross = true;
// Force left analog upwards
state.LY = 0;
// Force left analog downwards
// state.LY = 255;
// Force left analog to center
// state.LX = 128;
// state.LY = 128;
}
}
- Intercept ouput reports
- Emulating DualShock controller
{"STATUS_INTERNAL_ERROR: Unknown error in injected C++ completion routine. (Code: 15)"}
SOLUTION: Restart PS4 Remote Play.
DualshockState Could not be found
SOLUTION: Rename to DualShockState for version >= 0.2.0