Author Topic: About Input and some question  (Read 5475 times)

shokinhan

  • Guest
About Input and some question
« on: July 04, 2012, 01:54:32 AM »

I have some question:
1).The input can support "ctrl+c" and "ctrl + v" ?
2).The input can support mouse location?  eg:  Can User input the string above on the position of the mouse?
3).The OnHover's waittime is too long.
4). What's version will be published to slove these problems?
5). The  2.08 version  has been published?


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: About Input and some question
« Reply #1 on: July 04, 2012, 02:30:25 AM »
1) Unity doesn't expose copy/paste, so nope.
2) Phil was working on that last week, I don't believe he had a chance to finish though.
3) ?

Current latest version is 2.0.9.

joreldraw

  • Guest
Re: About Input and some question
« Reply #2 on: July 04, 2012, 09:16:54 AM »
Is possible to implement in UIinput Character selection?
With this we can make easy a copy paste script, only need "startselection" & "lenghtselection"

Nice too if in UIInput Carat Char can be intermitent how in all text controls.

PhilipC

  • Guest
Re: About Input and some question
« Reply #3 on: July 04, 2012, 10:00:35 AM »
I hadnt planned on adding the highlight functionality but it is doable (just a lot more work). Also the copy paste would only work in the application itself (if we were to allow that) because as Mike said Unity doesn't expose the clipboard.

Having the Carat Char be intermittent would be doable (if i were to add the highlight functionality).

joreldraw

  • Guest
Re: About Input and some question
« Reply #4 on: July 05, 2012, 01:09:21 AM »
With the selection option added on UIInput we can do a copy paste code withouth clipboard. Based on playersetting, storing the selected string and reading from playersetting to paste.

mikewoz

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 3
    • View Profile
Re: About Input and some question
« Reply #5 on: April 09, 2013, 10:39:05 AM »
There is a way to get the clipboard contents, described here:
http://answers.unity3d.com/questions/266244/how-can-i-add-copypaste-clipboard-support-to-my-ga.html

However, this doesn't work in the web player, and you'll probably have to use the native clipboard in iOS and Android by writing a Unity native plugin.

In order to add support for CTRL-V (or CMD-V) on MacOS, you need to go into the Update() method of UICamera and look override the input string (otherwise, you'll just get the 'V' character in your text input box). Something like this:

  1. if (mSel != null)
  2. {
  3.         string input = Input.inputString;
  4.                
  5.         // override input if CTRL-v (paste)
  6.         if ((Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.V)) ||
  7.                 (Input.GetKey(KeyCode.RightControl) && Input.GetKeyDown(KeyCode.V)) ||
  8.                 (Input.GetKey(KeyCode.LeftCommand) && Input.GetKeyDown(KeyCode.V)) ||
  9.                 (Input.GetKey(KeyCode.RightCommand) && Input.GetKeyDown(KeyCode.V)))
  10.         {
  11.                 input = ClipboardHelper.clipBoard;
  12.         }
  13.  
  14.         ...
  15.