I was trying to imitate this PR #4748 using LUA so I can adjust the mouse position according to the game's situation, but encountered a bug.
Summary
This LUA script breaks Bizhawk (DOSBox-x) mouse inputs:
while true do
input = joypad.get()
--print(input)
newInput = {};
newInput["Mouse Position Y"] = input["Mouse Position Y"] + 100
joypad.setanalog(newInput)
emu.frameadvance();
end
The expected behaviour is that it takes the mouse's Y position, and adds 100 to it, so that the in-game pointer is adjusted. Instead it breaks the input, making the Y position get stuck in the default forever.
Repro
- Open DOSBox core (any game will do) with mouse activated
- Move the mouse around and see the inputs move accordingly
- Now activate the LUA script above
- Mouse Position Y freezes out (bug)
- Deactivate the LUA script
- Bug still persists
Output
Mouse position X moves freely, but Y is stuck at default.
Host env.
Bizhawk 2.11.1; Windows 11, Intel/NVIDIA
I was trying to imitate this PR #4748 using LUA so I can adjust the mouse position according to the game's situation, but encountered a bug.
Summary
This LUA script breaks Bizhawk (DOSBox-x) mouse inputs:
The expected behaviour is that it takes the mouse's Y position, and adds 100 to it, so that the in-game pointer is adjusted. Instead it breaks the input, making the Y position get stuck in the default forever.
Repro
Output
Mouse position X moves freely, but Y is stuck at default.
Host env.
Bizhawk 2.11.1; Windows 11, Intel/NVIDIA