Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mouse Emulation Directinput #227

Open
ernestasga opened this issue Oct 27, 2024 · 1 comment
Open

Mouse Emulation Directinput #227

ernestasga opened this issue Oct 27, 2024 · 1 comment

Comments

@ernestasga
Copy link

Hi,

I'm trying to use TrackIR with FreePIE to emulate mouse movements. I have a script (see below) that works for most games:

def update():
   yaw = trackIR.yaw
   pitch = trackIR.pitch

   deltaYaw = filters.delta(-yaw)
   deltaPitch = filters.delta(-pitch)   

   if (enabled):
      mouse.deltaX = -deltaYaw * multiply
      mouse.deltaY = deltaPitch * multiply

if starting:
   system.setThreadTiming(TimingTypes.HighresSystemTimer)
   system.threadExecutionInterval = 1
   enabled = False
   multiply = 22
   trackIR.update += update

toggle = keyboard.getPressed(Key.Equals)

if toggle:
   enabled = not enabled

However, I installed Warzone today, and while the mouse emulation seems to work in menus, it stops working as soon as I'm in the game. I tested with Opentrack, which supports DirectInput, and it works in-game.

I believe the issue is that Warzone requires mouse input via DirectInput, and the current script (or FreePIE's mouse module) does not send mouse input via DirectInput.

My Question:

Is there a way to update this script to send mouse input as DirectInput so that it works in Warzone and other games that require DirectInput mouse input? Any guidance on how to modify the script or use different APIs in FreePIE to achieve this would be greatly appreciated.

Thank you!

@AndersMalmgren
Copy link
Owner

Here is a old article about hooking directx calls

https://www.codeproject.com/Articles/14040/Hooking-a-DirectX-COM-Interface

It might give some insight into how to create a plugin for freepie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants