Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Pasting clipboard into InputField on standalone Mac build pastes text twice.

Discussion in 'Editor & General Support' started by hasseyg, Apr 19, 2015.

  1. hasseyg

    hasseyg

    Joined:
    Nov 16, 2013
    Posts:
    78
    Hi, I have asked why this is happening on Unity Answers but I didn't receive any answers. The problem is that in the editor if you copy some text and then try to paste it into an InputField it works as expected. However on a standalone Mac build it pastes the text twice. I have no idea of how to fix this, does anybody know how I could do this?
     
  2. t1nkzi

    t1nkzi

    Joined:
    Jan 7, 2015
    Posts:
    9
    Hi, did you find something to solve the matter ?
    I'm experiencing the same !
    Good day
     
  3. skateborden

    skateborden

    Joined:
    Apr 1, 2009
    Posts:
    35
    I'm seeing this too, did either of you report the bug?
     
  4. skateborden

    skateborden

    Joined:
    Apr 1, 2009
    Posts:
    35
    I upgraded to 5.2 and it seems to be fixed.
     
    holliebuckets likes this.
  5. joshskelton

    joshskelton

    Joined:
    Aug 30, 2013
    Posts:
    22
    I'm running 5.2.3 and the problem is still there.
     
  6. joshskelton

    joshskelton

    Joined:
    Aug 30, 2013
    Posts:
    22
    Can anybody else confirm that this is still an issue or not? I'm trying to find a work around.
     
  7. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,851
  8. bhudson

    bhudson

    Joined:
    Nov 21, 2014
    Posts:
    31
    I'm able to workaround the paste bug on OSX by building the UI library:
    https://bitbucket.org/Unity-Technologies/ui/overview
    And modifying the InputField to ignore the second paste attempt in a single event loop.

    I store a private flag, initialized to false.

    I reset it to false at the start of
    Code (csharp):
    1. public virtual void OnUpdateSelected(BaseEventData eventData)
    In KeyPressed I only do the paste if the flag is off and then I set the flag.
    Code (csharp):
    1. if (!m_pastedThisLoop) { Append(clipboard); m_pastedThisLoop = true; }
    Success! I'm going to bet this is not a good idea to do on other platforms, but maybe it's benign.

    Regardless, the next thing I hit is the arrow keys not working in 5.2.3 (they work in 5.2.1 and 4.6.9).

    I've been wanting to move from NGUI to the new UI code, but the InputField keeps being broken in different magical ways in every version. Kind of a big problem.
     
  9. SuperMoog

    SuperMoog

    Joined:
    Jun 22, 2013
    Posts:
    2
    Yeah the arrow key bug is a nightmare. Fine in editor, not working on OSX desktop on 5.2.3 or 5.2.1 for me. Applied your paste fix which saved me some time.

    Very annoying, I am thinking of moving to nGUI
     
  10. elenzil

    elenzil

    Joined:
    Jan 23, 2014
    Posts:
    73
    good lord, arrow keys also not working in OSX desktop in 5.3.0f4
     
  11. elenzil

    elenzil

    Joined:
    Jan 23, 2014
    Posts:
    73
    what does that do for your compile times ?

    oh I see, you recompile the bundled DLL itself.