Bricklayer.Client.InputHandler.GetDigitPressed C# (CSharp) Method

GetDigitPressed() public method

Gets the current number key pressed, returns -1 if none
public GetDigitPressed ( ) : int
return int
        public int GetDigitPressed()
        {
            int key = -1;

            if (IsKeyPressed(Keys.D1)) key = 0;
            else if (IsKeyPressed(Keys.D2)) key = 1;
            else if (IsKeyPressed(Keys.D3)) key = 2;
            else if (IsKeyPressed(Keys.D4)) key = 3;
            else if (IsKeyPressed(Keys.D5)) key = 4;
            else if (IsKeyPressed(Keys.D6)) key = 5;
            else if (IsKeyPressed(Keys.D7)) key = 6;
            else if (IsKeyPressed(Keys.D8)) key = 7;
            else if (IsKeyPressed(Keys.D9)) key = 8;
            else if (IsKeyPressed(Keys.D0)) key = 9;

            return key;
        }