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

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

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...