Welcome, Guest

Author Topic: get a view in InputSimulator  (Read 169 times)


  • Posts: 57
    • View Profile
get a view in InputSimulator
« on: September 02, 2017, 02:41:03 PM »
Hi. How would I access a view from InputManager?
My view was created in a script called "main" which is attached to a game object called "go"

I've tried to add some code to ProcessCharEvent in InputSimulator but it doesn't work.
Code: [Select]
GameObject go=GameObject.Find("go");
main mainscript=go.GetComponent<main>;
mainscript.view.View.ExecuteJavascript("some script when a key is pressed");
But it gives errors.  main may not exist when InputManager is compiled but if I put main in plugins so it is compiled first I get other compilation errors.  Is there a way to access a view from InputManager? The reason for doing rather than through javascript is that chrome has a weird bug where addListener will not listen to key strokes while a standard <SELECT> is open so you can't record the keystrokes when a select is open using javascript.


  • Posts: 2
    • View Profile
Re: get a view in InputSimulator
« Reply #1 on: September 11, 2017, 06:44:06 AM »
Hi whimsica,

HTML's select elements require the creation of a new OS window which is not supported by Coherent UI. A way to work around this is to implement a custom dropdown like the one here or to directly use a library like ddSlick.

The way to access the View from the InputManager is via finding the game object and then getting the CoherentUIView component with myGameObject.GetComponent<CoherentUIView>(). As for the errors that you're seeing - it would be best to submit a ticket at support@coherent-labs.com where you can send us a log with the errors and the main script so that we can further assist you.

« Last Edit: September 11, 2017, 06:45:40 AM by rali »