Search Unity

Advanced Input Field

Discussion in 'Assets and Asset Store' started by fennecx_development, Jul 29, 2017.

  1. FaberVi

    FaberVi

    Joined:
    Nov 11, 2014
    Posts:
    146
    So you can not still select / copy text in read-only mode? I ask you why I would be interested in purchasing but I have the specific need to be able to select and copy text without the presence of the keyboard.
     
  2. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    Readonly mode allows using copy operations, but switching from non readonly mode (keyboard write allowed) to readonly mode (keyboard write blocked) on runtime doesn't work properly yet.
    I'll try to fix it in the next version of the plugin.

    Note: an example of readonly mode can be seen when opening the Form sample scene, filling in all the fields and pressing submit. This will take you to another screen with an inputfield that has readonly mode enabled .
     
    FaberVi likes this.
  3. FaberVi

    FaberVi

    Joined:
    Nov 11, 2014
    Posts:
    146
    Great looks, working fine. Only in the demo the menu copy key does not work and when I put in all the data I can not scroll the box properly. Is it just a demo problem or readonly can not scroll the text/copy?

    Ps: My need is to keep it always in readonly (only copy and select mode). I do not have to do any runtime switches.
     
  4. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    Hmm, that's weird.
    Now that I think of it you shouldn't have a paste option in that build (the ActionBar is only enabled on that second screen).
    IIRC Unity's clipboard feature only works in the app itself. If you try to paste it in another app it won't work.

    As for the scrolling, it's the same as Unity's implementation. Press inputField once to select, then press, hold and drag outside of the inputfield up/down to scroll up/down.
     
  5. FaberVi

    FaberVi

    Joined:
    Nov 11, 2014
    Posts:
    146
    You can integrate it for clipboard: https://assetstore.unity.com/packages/tools/utilities/unipasteboard-18863

    It would be possible to add some way to scrolling if you put it inside the input without it catching the event right away and let you select the text / you position the cursor? They are all features that make the current inputBox more usable and less "mechanical"
     
  6. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    I send you a PM to continue this conversation, so we don't fill this thread more.
     
    FaberVi likes this.
  7. friendlyfoxes

    friendlyfoxes

    Joined:
    Oct 24, 2015
    Posts:
    2
    I just bought the plugin and I noticed emoji are now stripped out as of 1.4.0. Could you explain why? Also, could you make this configurable, even if it's disabled by default?
     
  8. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    Some emoji would crash the plugin/app on the mobile platforms (strings were getting corrupted). I could add an option to disable the emoji blocker, but that would give the user a way to crash the app.
    Unfortunately the character range of emoji is rather complex. It's split into a lot of different ranges within Unicode.
     
  9. friendlyfoxes

    friendlyfoxes

    Joined:
    Oct 24, 2015
    Posts:
    2
    So really, emoji crashing the app is more of a Unity bug? I know it's also disabled in the built-in Input Field and has to be enabled manually in the native platform code.

    Would something like the now Unity-owned TextMesh Pro help the input field case at all? I know it does support emojis by automatically encoding and decoding them using Quads, and it does have an input field module. Once Unity integrates TextMesh Pro into the editor - would you support it in the Advanced Input Field asset?
     
    Last edited: Nov 20, 2017
  10. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    Well, the idea is to integrate Text Mesh Pro rendering when it's fully integrated in Unity, but I'm not sure it will solve the issue of string corruption. IIRC I got an internal Unity Engine string error when testing certain emojis.
     
  11. ohericoh

    ohericoh

    Joined:
    Sep 1, 2016
    Posts:
    8
    Hello, i'm interested in purchasing this asset but I was wondering if it will fix my current situation. I am developing an app for 2 surface pro 3's, one that runs on 8.1 and the other that runs on windows 10. My current situation is when a user writes text in an input field and makes a mistake, the user cannot tap in the middle of the text to delete and edit. Will this asset fix this problem?

    Side note the app will be built for UWP on the surface running windows 10. The 8.1 is built for windows store.
     
  12. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    The plugin currently only works for UWP on Windows 10 with the build type set to XAML. Does the app running on 8.1 need inputfields too?
    I can make a build of one of the sample scenes of the plugin for UWP (10 with build type XAML), if you want.
     
  13. ohericoh

    ohericoh

    Joined:
    Sep 1, 2016
    Posts:
    8
    If you can build a sample scene for UWP windows 10 that would be great and much appreciated. Don't worry about the windows 8.1, I believe it has been deprecated anyways so I can figure something out for that one.
     
  14. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    This is the dropbox link to the build (Form sample scene):
    https://www.dropbox.com/sh/19xxb6vu4hn911x/AADwJn_MvLtL-P89eZhSbxEHa?dl=0

    When testing I did notice the build acts weirdly in tablet mode (tested on Surface Pro 4). Not sure if your users will use tablet mode or use docked mode (connected to hardware keyboard)?

    Anyways, I'll try to fix the tablet mode for Surface Pro this weekend (I'll have some more time available then).
     
  15. AETechron

    AETechron

    Joined:
    Aug 9, 2016
    Posts:
    6
    In the Form demo APK (on Android) I noticed that the Arrow keys do not move the caret, but they do work properly in terms of moving the "behind the scenes" caret. Is there any chance that you could add support for arrow keys?

    My company is writing a Unity app for some hardware that does not have a touchscreen, just a mouse and keyboard. This issue is the only one I can see that would prevent us from purchasing your Asset.

    Thank you.
     
  16. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    This would require adding official support for hardware keyboards on Android. At the moment only software keyboards are supported and those don't have arrow keys. The 2 types of keyboards are handled differently on Android. Software keyboards directly modify the text (no individual key presses). IIRC Hardware keyboards do allow you catch individual key/character presses, but they need to be handled differently in code.
    The functionality to move to caret keys exists in the plugin, but only for Standalone platforms. Mobile platforms are handled differently. So it would require some more time to restructure the code.
    I'm currently already refactoring/restructuring to communication between Unity and the mobile bindings anyways, so I can take this into account too.

    It will probably take some time (a month or more) to get this working. I have some other things to implement/improve first. I don't know how quickly you need the functionality.
     
  17. AETechron

    AETechron

    Joined:
    Aug 9, 2016
    Posts:
    6
    Thank you for the reply!

    We have been dealing with the ugly inputfields for over a year now, so another "month or more" isn't the end of the world honestly. We've been begging Unity to fix this problem to no avail, so we really appreciate someone taking matters into their own hands. :)

    Thanks again!
     
  18. ohericoh

    ohericoh

    Joined:
    Sep 1, 2016
    Posts:
    8

    Sorry for the late response, busy week. It doesn't need to be in tablet mode but there will be no physical keyboard attached to the device.

    by "acting weirdly" do you mean the touch screen keyboard was flashing and couldn't get into focus?
     
  19. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    Yes, the whole showing the touchscreen keyboard and keeping it in focus is acting weird (on Surface Pro in tablet mode). My other test device for UWP (a windows phone) doesn't have that issue. The platform is called UWP (Universal Windows Platform), but it doesn't seem to act the same on all devices with a touchscreen.

    I'm currently rewriting the code for the mobile bindings. UWP seems to be most buggy one. Haven't found a stable solution/workaround to get it to work each time you start the UWP app on Surface Pro tablet mode.

    Anyways, so basically for your setup you'll need a third mode (pc mode + on screen keyboard). Atm it only switches between pc mode (expects hardware keyboard) and tablet mode (uses touchscreenkeyboard). I'll see if I can implement that one too, now that I'm rewriting the UWP part of the plugin.
     
  20. ohericoh

    ohericoh

    Joined:
    Sep 1, 2016
    Posts:
    8
    I see what you mean. It seems to work in pc mode when I swipe right and open keyboard. So if that's the case i'll be able to touchscreenkeyboard.open() and have it working on my app once I buy this plugin correct?

    Ended up purchasing the plugin and it works great. I used a onclickevent to open mobile keyboard etc. Thanks for all your help.
     
    Last edited: Jan 3, 2018
  21. ohericoh

    ohericoh

    Joined:
    Sep 1, 2016
    Posts:
    8
    Follow up question, when I use an imported font, the placeholder text doesn't show.
     
  22. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    Two things to check:
    1. The actual placeholder text renderer is in a child gameobject named "Processed" of Text gameobject of the InputField.
    2. Make sure the font size isn't too big (test smaller sizes if needed)
     
  23. Jochanan

    Jochanan

    Joined:
    Nov 9, 2016
    Posts:
    85
  24. ohericoh

    ohericoh

    Joined:
    Sep 1, 2016
    Posts:
    8
    @jpienbro It was the font size. For some reason the text font size fit but the placeholder did not. Thanks!
     
  25. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    The plugin doesn't contain this functionality at the moment. I think it should be possible, but it might give issues with text editing when the inputfield becomes larger than the screen height. Maybe it could work if I add a max lines property too when implementing that functionality.

    I can add it to the TODO list of the plugin, but I don't think I can implement it anytime soon (other feature requests/fixes pending atm).
     
  26. Otto_Oliveira

    Otto_Oliveira

    Joined:
    Jul 24, 2014
    Posts:
    33
    Hi @jpienbro ,
    I purchased your plugin to basically hide the input bar on android devices and to know the keyboard area size. Is it possible to still use other input methods? I really don't want to change all components.

    Thanks
     
  27. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    What input methods do you mean?
    If you mean the default Unity inputfield, then that might cause issues. Unity has it's own mobile binding for the TouchScreenKeyboard for Android and might leave it in a state my plugin doesn't expect.
     
  28. Otto_Oliveira

    Otto_Oliveira

    Joined:
    Jul 24, 2014
    Posts:
    33
    Alright.

    I saw that emoji support was blocked, because it was crashing the app. Is there an option to toggle on anyway?

    Thanks
     
  29. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    No, there isn't an option currently to enable emoji characters on the mobile platforms in the plugin atm.
     
  30. Jotesting

    Jotesting

    Joined:
    Jul 24, 2012
    Posts:
    5
    Hey,

    can we disable the small input field above the keyboard on iOS? That would be very helpful .

    Thanks
     
  31. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    Do you mean the bar with the word suggestions or an attached inputfield? IIRC Unity's implementation has a attached inputfield on Android, not on iOS. This plugin doesn't show attached input fields on the touchscreenkeyboards of the mobile platforms. (if that was your question)

    See the screenshots on Asset Store page to see how it looks on iOS & Android.
     
  32. Otto_Oliveira

    Otto_Oliveira

    Joined:
    Jul 24, 2014
    Posts:
    33
    Could you send to me an older plugin version that has emoji support?
     
  33. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    I've attached the version before the emoji block.

    Not sure if it will actually be useful to you as it sends the emojis (string) to the Unity side, but doesn't render them. Unity's Text implementation just renders them as question marks. (I'm waiting for complete TextMeshPro integration in Unity)
    Also some "invalid" emoji will just make the app crash on some mobile devices.

    Edit: removed the file, because already downloaded and don't want to leave an older yet full version here. Should have send it in a PM :p
     
    Last edited: Jan 8, 2018
    Otto_Oliveira likes this.
  34. by342854406

    by342854406

    Joined:
    Mar 12, 2017
    Posts:
    4
    it can not build with android sdk 22,how ?
     
  35. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    Weird, I checked the Android side of the plugin and the min sdk is 16, so it should compile.
    Could you send me the error Unity outputs in the log? Maybe it's something else that prevents compilation.
     
  36. Vertecx

    Vertecx

    Joined:
    Feb 22, 2017
    Posts:
    1
    Hi, I have a problem with implementing this plugin to my project. I threw in 1 advancedInputField to my project's canvas, but im getting the following errors on Android build as soon as the app is loaded. No errors on the Editor. What am i missing? Looks like the plugin script is missing reference? Is it possible this is an android manifest merge issue?

    Note: Replicating above on a new scene seems to work though.. but cant use it for our app. Please help!

    NullReferenceException: Object reference not set to an instance of an object
    01-10 13:19:40.326 31219 31238 E Unity : at AdvancedInputFieldPlugin.Util.DetermineThumbSize () [0x00000] in <filename unknown>:0
    01-10 13:19:40.326 31219 31238 E Unity : at AdvancedInputFieldPlugin.MobileTextNavigator.UpdateCursorSize (Single canvasScaleFactor) [0x00000] in <filename unknown>:0
    01-10 13:19:40.326 31219 31238 E Unity : at AdvancedInputFieldPlugin.MobileTextNavigator.OnCanvasScaleChanged (Single canvasScaleFactor) [0x00000] in <filename unknown>:0
    01-10 13:19:40.326 31219 31238 E Unity : at AdvancedInputFieldPlugin.AdvancedInputField.get_Canvas () [0x00000] in <filename unknown>:0
    01-10 13:19:40.326 31219 31238 E Unity : at AdvancedInputFieldPlugin.TextNavigator.get_Canvas () [0x00000] in <filename unknown>:0
    01-10 13:19:40.326 31219 31238 E Unity : at AdvancedInputFieldPlugin.MobileTextNavigator.Initialize (AdvancedInputFieldPlugin.AdvancedInputField inputField, UnityEngine.UI.Image caretRenderer, AdvancedInputFieldPlugin.TextSelectionRenderer selectionRenderer) [0x00000] in <filename unknown>:0
    01-10 13:19:40.326 31219 31238 E Unity : at AdvancedInputFieldPlugin.AdvancedInputField.InitializeInputField () [0x00000] in <filename unknown>:0
    01-10 13:19:40.326 31219 31238 E Unity : at AdvancedInputFieldPlugin.Advanced
     
    Last edited: Jan 10, 2018
  37. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    Check your PM
     
  38. fmelogno

    fmelogno

    Joined:
    Oct 2, 2016
    Posts:
    24
    Hello, I have two questions before buy yor asset.
    First, Can I use this asset to hide the native keyboard on the mobile platform when focus on inputfield to implement my custom 3rd keyboard?
    Second, can I use TextMeshProUGUI as a placeholder?
    Thanks..
     
  39. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    1. If you mean using another keyboard on Android: The plugin uses whatever keyboard (can be third-party) is configured on the device. You can't force it to load a specific keyboard.
    2. TextMeshPro support is planned for the future: Currently waiting until Unity fully integrates it in the engine.
     
  40. Scale1Portal

    Scale1Portal

    Joined:
    Jan 27, 2015
    Posts:
    21
    I'm working on iOS with dual display through AppleTV ; For some reason it seems the Keyboard always tries to display itself on the secondary Display, not on the Primary (iPhone) display ; do you know if there could be a workaround to this behaviour?
    Thks
     
  41. tranos

    tranos

    Joined:
    Feb 19, 2014
    Posts:
    180
    Hello,
    I am interested in your plugin and I would like a clarification.
    In the examples when you press "done" it auto selects the next inputfield.
    Is there an option to show both "next" and "done" in mobile and let the user choose what to do next?
     
  42. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    Hmm. I don't have an AppleTV myself so I can't really test. In the iOS native binding of the plugin it doesn't really specify a target display, so I have no clue how AppleTV determines this.
     
  43. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    IIRC It's not possible with the normal OS keyboard on Android. Usually user just use the back button or press/select something else to hide the keyboard when wanted.
    In the plugin the done/next key will work as next if next inputfield specified and as done if none is specified.
     
  44. cmbellman

    cmbellman

    Joined:
    Sep 19, 2013
    Posts:
    20
    Hi,

    In some of my input fields I get the caret showing in the middle of the field when I first show it, also no placeholder text is shown. If I type a letter it jumps to the correct position, and if I backspace and remove the character the cursor is correctly positioned at the start of the empty field and placeholder text is shown.

    Do you have any idea of how to initialize the field to show it correctly with placeholder text and caret at the left from the start? I programatically show the field when a user hits a button, and use ManualSelect to activate it.

    EDIT: On Android the caret seem to position correctly even first time. In the Editor player it's not. Placeholder problem I can get around with this code:

    Code (csharp):
    1.  
    2.         if (input.Text == "") {
    3.             input.ProcessedTextRenderer.enabled = true;
    4.         }
    5.  
     
    Last edited: Jan 30, 2018
  45. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    Thanks for the report.
    I had implemented a fix before, but that one doesn't seem to work on all platforms. (Issue is being caused by Text component not reporting the correct position for the caret on start). Will recheck and see if can find a workaround that works on all platforms.

    Placeholder seems to work in the sample scenes. Are you changing the Placeholder on runtime using code perhaps?

    I've added both issues to the TODO list on Trello: See https://trello.com/b/0qda8XOp/advanced-input-field
    The things that are "in progress" will be included in next release. (Current development version isn't really stable yet because I'm rewriting the native bindings of the plugin).
     
  46. MarcoPoloKieran

    MarcoPoloKieran

    Joined:
    Jun 5, 2017
    Posts:
    1
    Hi, I've noticed that when ContentType is set to Name, you can still enter £ and ' characters in the field.
    Also, on iOS when the native "Undo" button is pressed, the plugin causes a crash.
    Any idea when these issues might be fixed?
     
  47. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    I could reproduce both issues on my test device.
    I've added them to my TODO list.
    Next version will include fixes for these issues and is planned somewhere next month (February).
    If you have a deadline soon, I can make a hotfix for the old version, but rather avoid it as a lot has changed in the native bindings (current development version).
     
  48. cmbellman

    cmbellman

    Joined:
    Sep 19, 2013
    Posts:
    20
    I have another question. When I activate an advanced input field on my android phone, the entire screen seems to offset some pixels down, and leave a black area on the top (no matter what camera background I use, so it seems this is outside of unity). This does not happen when activating an UGUI input field. Do you know about this issue and can it be avoided (it looks strange because I use full screen with semi transparent status bar and when this happens a tiny portion behind the status bar gets black instead of the background color I have decided to use).


     
    Last edited: Feb 3, 2018
  49. fennecx_development

    fennecx_development

    Joined:
    Sep 24, 2014
    Posts:
    427
    That's a really weird issue.
    Does it only happen on that particular Android device and what model is it?
    Does it have the default (stock) rom installed that came the device or a custom one?
    The plugin does add a native inputfield (of Android) to the main UI, but that didn't give issues on my test devices and nobody else reported problem with it before.
    Maybe it's something in the Android OS version on the device that is handling the native code differently.
     
  50. hexaust_

    hexaust_

    Joined:
    Mar 7, 2015
    Posts:
    23
    Hi there, I have just purchased the Advanced Input Field plugin and I was wondering if there is any way that I can prevent the keyboard from hiding when the input loses focus and only hide it on a certain action. For example when I press a button.

    Thank you.