Welcome, Guest

Author Topic: Can a raycast to coherentUI trigger a browser mouse click?  (Read 3917 times)

Tony

  • Administrator
  • *****
  • Posts: 28
    • View Profile
Can a raycast to coherentUI trigger a browser mouse click?
« Reply #15 on: August 28, 2017, 03:14:35 AM »
Hi whimsica,

In our native documentation for Coherent GT, you can find the definition of the MouseEventData struct.

Additionally, <path_to_project>/Assets/StandartAssets/Detail/CoherentUIGTInputManager.cs contains all the logic for processing input events. You can refer to it for additional information on the matter.

Best,
Tony.

whimsica

  • Posts: 59
    • View Profile
Re: Can a raycast to coherentUI trigger a browser mouse click?
« Reply #16 on: September 02, 2017, 02:33:22 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>;
mainscipt.view.View.ExecuteJavascript("some script");//when a key is pressed.
But it gives errors.  mainscript may not exist when InputManager is compiled but if I put mainscript 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 using javascript.

whimsica

  • Posts: 59
    • View Profile
Re: Can a raycast to coherentUI trigger a browser mouse click?
« Reply #17 on: September 02, 2017, 02:35:55 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>;
mainscipt.view.View.ExecuteJavascript("some script");//when a key is pressed.
But it gives errors.  mainscript may not exist when InputManager is compiled but if I put mainscript 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 using javascript.

bangcap

  • Posts: 1
    • View Profile
Re: Can a raycast to coherentUI trigger a browser mouse click?
« Reply #18 on: November 20, 2017, 06:42:25 PM »
Wow! Your code is a lot simpler than I thought it would have to be.
It's working great.

Thanks for the amazing support.

Tags: