- Home /
Embed standalone player and Input.GetAxis
Hi,
I'm trying to use an embed standalone player in a windows Form. The command line -parentHWND works.
But I have a problem with my mouse inputs.
Input.GetMouseButton and Input.mousePosition are well detected but I can't get drag information. Input.GetAxis("Mouse X") and Input.GetAxis("Mouse ScrollWheel") are always 0.
The same player is working if I don't embedded it in my form.
private void Form1_Load(object sender, EventArgs e)
{
process = new Process();
process.StartInfo.FileName = @".\Player.exe";
process.StartInfo.Arguments = "-parentHWND " + panelAx.Handle.ToInt32() + " " + Environment.CommandLine;
process.StartInfo.UseShellExecute = true;
process.StartInfo.CreateNoWindow = true;
process.Start();
}
I think my form is intercepting windows messages.
Thanks,
Answer by HPx · Aug 20, 2015 at 01:23 PM
There is a workaround. You need to force activation with unity handle
private void Form1_Activated(object sender, EventArgs e)
{
SendMessage(WinUnityHandle, WM_ACTIVATE, WA_ACTIVE, 0);
}
Your answer
Follow this Question
Related Questions
Image in wrong position on standalone build. 0 Answers
Vulkan Frame Dropping 0 Answers
Ubuntu System.windows.forms dont open 0 Answers
Web Player failing to receive inputs after changing tabs 0 Answers
HTC Vive XR Input not working 0 Answers