TMP_InputField Dark Keyboard Option

Looking through the TMP_InputField code I don’t see a clear way to set the mobile keyboard (m_SoftKeyboard) alert field to true. This is how you produce a dark themed keyboard. https://docs.unity3d.com/Manual/MobileKeyboard.html
It would be great to have the option to set this, or to be able to override that function if it was virtual and handle that part myself.
There is no option for a Search type keyboard either.
I know you can disable the soft keyboard and write your own, but it would be great if you could keep the functionality in the InputField already there.

I have not had the time to experiment with these keyboard options. If they all work, it should be simple to expose that functionality.

That would be fantastic! Given the trend of dark mode we are seeing everywhere it would be great to have that option.

It’s a super hacky 2 minute fix… I’d only do this if you’re in a bind and don’t want to/can’t mess with custom keyboards. Also, when you update packages, reimport, etc it’ll likely get overridden - but with those disclaimers in mind, I…

  1. Created a public bool that I called “isAlert” in TMP_InputField.cs

  2. Replaced “true” with the public bool in the open keyboard calls

  3. Set the bool from my dark mode logic

Works like a charm. If TMP ends up getting overridden/reimported, I’ll have to remember where I did it… but it gets the job done.

2 Likes

@Stephan_B what can we do to put this for the next release of TMP?

Just curious about the naming of “isAlert”? Does that have a specific meaning on iOS?

Why not have a property called “isDarkMode” or a enum for LightMode or DarkMode?

Thoughts?

I made the relevant changes and added the new property “isAlert” as requested :slight_smile:

1 Like

I was just using the name of the property that appears to have been chosen by the TextMeshPro team. I have no idea why it’s called that and would much prefer “isDarkMode” or something along those lines.

Where would I access/find this update? Also - do lines 4064/4065 in the image above use this new property so that if it’s set, it displays based on that bool?