We’re working on the educational app (Windows 8.1 Store app) which is using Unity to display interactive exercises for students. When the unity gets shown in the app the scene doesn’t get an input focus. The only way to get it back is temporary switch to a start or a desktop and then back. How can we set the focus programmaticly?
Looke like an issue with independent input source. Try to disable it.
I’ve tried to add:
appCallbacks.AddCommandLineArg(“-disable-independent-input-source”);
appCallbacks.AddCommandLineArg(“-disable-low-latency-presentation-api”);
It still doesn’t fix the issue.
Which version of Unity do you use?
And how do you launch an application (dual monitor, split screen)?
We’re using the 4.3 version.
The application is launched full screen on a tablet device. The Unity is not hosted on the first (main) page. We navigate to it at some point in the app.
Thanks… Alex
A blind guess, try calling UnitySetInput(0), UnitySetInput(1) from AppCallbacks
I am not actually sure that scenario you’re describing is supported.
You could fill a bug
Hi Tomas1956,
At which point I can call into these?
I am getting Win32 exception when calling it before InitializeD3DXAML.
Thanks… Alex
UnitySetInput() is for disabling and reenabling input routing to Unity app when it’s already running, so you shouldn’t call it before initialize.
It should be safe to call these after extended splash screen is removed.
BTW, what kind of exception do you get. Perhaps we should fix it to throw something meaningful?
OK, so I’ve tried to call it after the splash is removed, put it in the DispatcherTimer, etc… The fist call to UnitySetInput(false) just never returns for me and locks everything up.
Are you calling from UI thread? UnitySetInput() must be called from UI thread, if you’re on other thread, use AppCallbacks.InvokeOnUIThread().
Yes I am calling it from the UI thread. I even tried to call it with AppCallbacks.InvokeOnUIThread() with the same result.
Thanks… Alex
In that case please report a bug.
Bug report has been submitted.