Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

TextMesh Pro Hide Mobile Input... does not work

Discussion in 'Unity UI & TextMesh Pro' started by Player7, Jul 4, 2017.

  1. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,191
    Has no effect, on screen mobile keyboard shows up regardless.

    tested on 2017.1 (android)
     
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    1,951
    I believe this is an issue on Android where you cannot hide the mobile keyboard.
     
  3. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,191
    well the workaround is not to call "TouchScreenKeyboard.Open" if "shouldHideMobileInput" is true... as "TouchScreenKeyboard.hideInput = shouldHideMobileInput" is not working from what I'm finding.
     
  4. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    1,951
    Were you able to test this on your end?

    I am traveling for most of the day today but I'll try to take a look when I get to my destination.
     
  5. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,191
    yes that adjustment worked, don't suppose you plan to make a much more customizable virtual onscreen keyboard for unity? :D

    I just found the device OS one to be a bit overkill in screenspace taken up for the input required.
     
  6. rgonsalv

    rgonsalv

    Joined:
    Sep 29, 2016
    Posts:
    23
    This still does not work in the free version of TMPro, running on Android/Unity5.6.
     
  7. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    1,951
    This is not a limitation of TMP but a limitation with regards to features available to TMP. The Unity mobile team is working on improving their API to provide more functionality so that such features can be supported on all platforms.
     
  8. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,191
    Is this fixed now?
     
  9. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,191
    ok.. just tested.. no it still does not .<{"!"}{!$ing work ...how long will this take.. even setting the input field to read only and disable mobile keyboard.. on the tmp input component.. and the mobile keyboard pops up.. this is just stupid and I can't believe it has been a over year since reported.
     
  10. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    1,951
    I am working on the Input Field right now but like I said before this isn't specific to TMP but to the Android API available via the Input class.

    This "shouldHideMobileInput" from what I am told is only supposed to hide the part of the virtual keyboard where you can edit the input. Ie. it is not supposed to hide the virtual keyboard or prevent it from showing up which as what I thought this property was supposed to do in the first place.

    The following "android:windowSoftInputMode="stateAlwaysHidden" can also be added to an AndroidManifest.xml but it doesn't appear to prevent the virtual keyboard from showing up either.

    I have brought this up again to the mobile team to see if there is an ETA on if / when this functionality can be supported.

    In the meantime and like I said, I am working on the Input Field so maybe I can come up with some alternative way to get around this. Just to confirm, you want to complete suppress / prevent the virtual keyboard from showing up not just the single line above the virtual keyboard that allows inline editing of the text.
     
    Last edited: Dec 22, 2018
  11. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,191
    Yes complete suppression, am doing my custom virtual keyboard for it, just the android one you have very little control over layout and its positioning which is pretty annoying..almost think unity should do a custom keyboard that can be customized a lot more than the default built in os keyboard.
     
  12. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    1,951
    How are you feeding the character input from your virtual keyboard to the Input Field? Ie. by updating the text on the Input Field or creating / simulating KeyDown events and calling ProcessEvent()?

    P.S. Did some testing and should be able to control the handling of showing the virtual keyboard by the Input Field itself.

    Update - This will need further testing but ... assuming all goes well.

    upload_2018-12-22_16-15-7.png
     
    Last edited: Dec 23, 2018
  13. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,191
    How are you feeding the character input from your virtual keyboard to the Input Field?

    yeh I feed the virtual button inputs into an event that just adds the characteriinput field

    "Ie. by updating the text on the Input Field or creating / simulating KeyDown events and calling ProcessEvent()?"

    You have a code example on that, my next plan was to capture actual desktop keyboard input and have the virtual ugui keyboard visually show keypress on the buttons.

    Is this version in a package I can test with now?
     
  14. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    1,951
    This will be available in the next package release which should be available in the next 7 to 10 days (sort of influx due to holidays).
     
  15. Little-Big-Monkey

    Little-Big-Monkey

    Joined:
    Mar 4, 2014
    Posts:
    34
    I have the exact same problem, but on ios. Will it work for this platform too ?
    I'm also interested in an example of how to simulate key down events.
     
    Last edited: Dec 24, 2018
  16. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,191
    What is the difference between 'hide mobile input' and 'hide mobile keyboard' seems like it should be the same thing no?
     
  17. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    1,951
    Hide mobile input hides the single text field (red box as seen blow) above the virtual keyboard. This allows key input but in the game screen Input Field.

    upload_2018-12-24_14-4-21.png

    Hide mobile keyboard will hide the entire virtual keyboard.
     
  18. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    1,951
    Hide mobile input should be working as expected on iOS. This new hide mobile keyboard option should also work on all mobile platforms.

    The following would simulate a key input.

    Code (csharp):
    1.  
    2. Event e = new Event();
    3. e.character = 'e';
    4. e.keyCode = KeyCode.E;
    5. e.type = EventType.KeyDown;
    6.  
    7. m_InputFieldComponent.ProcessEvent(e);
    8. m_InputFieldComponent.ForceLabelUpdate();
    9.  
     
  19. Little-Big-Monkey

    Little-Big-Monkey

    Joined:
    Mar 4, 2014
    Posts:
    34
    Thank you, it's really interesting.
    But I will stick to my own solution, because it does not manage the caret position.
     
  20. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,191

    will it be out this week?
     
  21. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    1,951
    I am working on it. I also ran into issue with IME which I would like to address as well.
     
  22. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,191
    IME?
     
  23. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    1,951
  24. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,191
    Will it be out this week?
     
  25. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    1,951
    I am getting close but would like to get some repros / simple test scenes from some of you to enable me to further test this to make sure I didn't overlook anything and that is behaves as expected.
     
  26. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,191
    I don't have anything small to do that old bug reports could test this? soon as its out will give it a test and see if the main issue of androids keyboard doesn't show up when clicking on any input and instead just my own overlay one (which still needs more work but I haven't really done much with it since this issue has been in the way)
     
  27. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,191
    Will it be this week?
     
  28. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    1,951
    If not, I'll go for a preview release.