I'm working on a mod to play Stardew Valley by voice without using keyboard or mouse. In order to do this the mod needs to simulate keyboard and mouse events when speech is recognized. The keyboard bit is relatively straightforward to imitate with DirectInput, but it seems that mouse clicks are being suppressed. Right now I have the following workaround with SMAPI:
dynamic inputState = Utils.GetPrivateField(helper.Input, "CurrentInputState")();
Utils.GetPrivateField(inputState, "CustomPressedKeys").Add(SButton.MouseLeft);
Utils.SetPrivateField(inputState, "HasNewOverrides", true);
It would be great if there was a public API so this felt a bit less hacky/fragile.
I'm working on a mod to play Stardew Valley by voice without using keyboard or mouse. In order to do this the mod needs to simulate keyboard and mouse events when speech is recognized. The keyboard bit is relatively straightforward to imitate with DirectInput, but it seems that mouse clicks are being suppressed. Right now I have the following workaround with SMAPI:
It would be great if there was a public API so this felt a bit less hacky/fragile.