Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Keypad input doesn't work

Discussion in 'Project Tiny' started by Sarkahn, Nov 27, 2020.

  1. Sarkahn

    Sarkahn

    Joined:
    Jan 9, 2013
    Posts:
    440
    With the following script

    Code (CSharp):
    1. using Unity.Entities;
    2.  
    3. using Unity.Tiny;
    4. using Unity.Tiny.Input;
    5.  
    6. [AlwaysUpdateSystem]
    7. public class InputTest : SystemBase
    8. {
    9.     InputSystem Input;
    10.  
    11.     void TryKey(KeyCode key)
    12.     {
    13.         if (Input.GetKeyDown(key))
    14.             Debug.Log($"{key} pressed");
    15.     }
    16.  
    17.     protected override void OnUpdate()
    18.     {
    19.         Input = World.GetExistingSystem<InputSystem>();
    20.  
    21.         TryKey(KeyCode.LeftArrow);
    22.         TryKey(KeyCode.RightArrow);
    23.         TryKey(KeyCode.UpArrow);
    24.         TryKey(KeyCode.DownArrow);
    25.  
    26.         TryKey(KeyCode.Keypad0);
    27.         TryKey(KeyCode.Keypad1);
    28.         TryKey(KeyCode.Keypad2);
    29.         TryKey(KeyCode.Keypad3);
    30.         TryKey(KeyCode.Keypad4);
    31.         TryKey(KeyCode.Keypad5);
    32.         TryKey(KeyCode.Keypad6);
    33.         TryKey(KeyCode.Keypad7);
    34.         TryKey(KeyCode.Keypad8);
    35.         TryKey(KeyCode.Keypad9);
    36.     }
    37. }
    38.  
    It only prints for arrow keys, numpad/keypad keys don't seem to register at all. This is version 0.31.
     
  2. AbdulAlgharbi

    AbdulAlgharbi

    Unity Technologies

    Joined:
    Jul 27, 2018
    Posts:
    319
    Hi
    thanks for reporting this issue
    I can confirm the bug
     
    Sarkahn likes this.