Search Unity

Bug Ctrl+C,Ctrl+V not work

Discussion in 'Scripting' started by chengwang2077, Sep 27, 2020.

  1. chengwang2077

    chengwang2077

    Joined:
    Nov 23, 2019
    Posts:
    131
    Ctrl+D works
    Ctrl+C,Ctrl+V not work

    system : windows 10 enterprise
    unity version : 2020.1.2f1c1
    language : chinese
     
  2. Deleted User

    Deleted User

    Guest

    Hi,
    Could your try the following script in an empty project and see what Ctrl, C and D return in the console?
    Code (CSharp):
    1. using UnityEngine;
    2. using System;
    3. using System.Linq;
    4.  
    5. public class Test : MonoBehaviour
    6. {
    7.     // test to make sure that your keyboard is recognized by Unity (for non English keyboards)
    8.     private static readonly KeyCode[] KeyCodes = Enum.GetValues(typeof(KeyCode))
    9.         .Cast<KeyCode>()
    10.         .Where(k => ((int)k < (int)KeyCode.Mouse0))
    11.         .ToArray();
    12.  
    13.     // Update is called once per frame
    14.     private void Update()
    15.     {
    16.         if (Input.anyKeyDown)
    17.         {
    18.             for (int i = 0; i < KeyCodes.Length; i++)
    19.             {
    20.                 KeyCode kc = KeyCodes[i];
    21.                 if (Input.GetKeyDown(kc))
    22.                     Debug.Log($"Input detected: {kc.ToString()}");
    23.             }
    24.         }
    25.     }
    26. }
     
  3. chengwang2077

    chengwang2077

    Joined:
    Nov 23, 2019
    Posts:
    131
    I just tried it, and no information was printed. Ctrl+C, Ctrl+D can be copied and pasted in the hierarchy window, but not in the project window.
     
  4. Deleted User

    Deleted User

    Guest

    Looks like you need to file a bug report then. :)

    The script needs to be tested in play mode. Did you try other keys when you tested the script to see what they returned in the console?
     
  5. chengwang2077

    chengwang2077

    Joined:
    Nov 23, 2019
    Posts:
    131
    I don't know why the message was not printed before, Now every key will print a message like
    Input detected: C
    UnityEngine.Debug:Log(Object)
    Test:Update() (at Assets/Test.cs:22)
    Is it normal that the asset window can not copy and past by Ctrl C+V, or is it a bug?
     
  6. Deleted User

    Deleted User

    Guest

    Take a look in Edit/Shortcuts... In "Main Menu", make sure Ctrl+C and Ctrl+V are assigned. If they are not, try assigning them and test them; if they don't work, file a bug report.

    Capture d’écran_2020-09-27_11-27-51.png