Jump to content

Need help to get around bug in game where typing in search box in editor passes keystrokes to mods


Recommended Posts

I think the subject says it all.

The problem is that when you are typing in the search box, and, for example, type the letter "c", that letter is passed to EditorExtensionsRedux which then processes it.

How can I detect when someone is typing in the search box, so that I can ignore those characters?

thanks in advance

 

LGG

Link to comment
Share on other sites

Something along the line of

GameObject obj = EventSystem.current.currentSelectedGameObject;
bool inputFieldIsFocused = (obj != null && obj.GetComponent<InputField>() != null && obj.GetComponent<InputField>().isFocused);

 

Link to comment
Share on other sites

22 minutes ago, sarbian said:

Something along the line of


GameObject obj = EventSystem.current.currentSelectedGameObject;
bool inputFieldIsFocused = (obj != null && obj.GetComponent<InputField>() != null && obj.GetComponent<InputField>().isFocused);

 

From what I can tell, EventSystem was introduced in 4.6;  isn't KSP using 4.5?

Link to comment
Share on other sites

Just now, linuxgurugamer said:

From what I can tell, EventSystem was introduced in 4.6;  isn't KSP using 4.5?

i am at loss for words.

Link to comment
Share on other sites

5 minutes ago, sarbian said:

i am at loss for words.

well, I guess I did some bad research :-)

So why am I getting the EventSystem does not existin the current context?

 

I have the following using statements:

using UnityEngine;
using UnityEngine.UI;

 

6 minutes ago, linuxgurugamer said:

well, I guess I did some bad research :-)

So why am I getting the EventSystem does not existin the current context?

 

I have the following using statements:

using UnityEngine;
using UnityEngine.UI;

 

Never mind, found it:

using UnityEngine.EventSystems;

Oh, and thank you for the help

Edited by linuxgurugamer
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...