Пример #1
0
        /** <summary> Gets the name of the specified key. </summary> */
        public static string GetKeyName(Keys keyCode)
        {
            string name = Enum.GetName(typeof(Keys), keyCode);

            if (name.Length == 2 && name[0] == 'D' && name[1] >= '0' && name[1] <= '9')
            {
                return(name[1].ToString());
            }
            return(name);
        }
Пример #2
0
 /** <summary> Returns true if the specified key was typed. </summary> */
 public static bool IsKeyTyped(Keys keyCode)
 {
     return(keys[(int)keyCode].IsTyped());
 }
Пример #3
0
        //=========== KEY INFO ===========
        #region Key Info

        /** <summary> Gets the specified key. </summary> */
        public static InputControl GetKey(Keys keyCode)
        {
            return(keys[(int)keyCode]);
        }
Пример #4
0
 /** <summary> Returns true if the specified key was released. </summary> */
 public static bool IsKeyReleased(Keys keyCode)
 {
     return(keys[(int)keyCode].IsReleased());
 }
Пример #5
0
 /** <summary> Returns true if the specified key is up. </summary> */
 public static bool IsKeyUp(Keys keyCode)
 {
     return(keys[(int)keyCode].IsUp());
 }
Пример #6
0
        //========== KEY STATES ==========
        #region Key States

        /** <summary> Returns true if the specified key was pressed. </summary> */
        public static bool IsKeyPressed(Keys keyCode)
        {
            return(keys[(int)keyCode].IsPressed());
        }
Пример #7
0
 /** <summary> Returns true if the specified key is down. </summary> */
 public static bool IsKeyDown(Keys keyCode)
 {
     return(keys[(int)keyCode].IsDown());
 }
Пример #8
0
 /** <summary> Returns true if the specified key is up. </summary> */
 public static bool IsKeyUp(Keys keyCode)
 {
     return keys[(int)keyCode].IsUp();
 }
Пример #9
0
 /** <summary> Gets the specified key. </summary> */
 public static InputControl GetKey(Keys keyCode)
 {
     return keys[(int)keyCode];
 }
Пример #10
0
 /** <summary> Returns true if the specified key was typed. </summary> */
 public static bool IsKeyTyped(Keys keyCode)
 {
     return keys[(int)keyCode].IsTyped();
 }
Пример #11
0
 /** <summary> Returns true if the specified key was released. </summary> */
 public static bool IsKeyReleased(Keys keyCode)
 {
     return keys[(int)keyCode].IsReleased();
 }
Пример #12
0
 /** <summary> Returns true if the specified key was pressed. </summary> */
 public static bool IsKeyPressed(Keys keyCode)
 {
     return keys[(int)keyCode].IsPressed();
 }
Пример #13
0
 /** <summary> Returns true if the specified key is down. </summary> */
 public static bool IsKeyDown(Keys keyCode)
 {
     return keys[(int)keyCode].IsDown();
 }
Пример #14
0
 /** <summary> Gets the name of the specified key. </summary> */
 public static string GetKeyName(Keys keyCode)
 {
     string name = Enum.GetName(typeof(Keys), keyCode);
     if (name.Length == 2 && name[0] == 'D' && name[1] >= '0' && name[1] <= '9')
     return name[1].ToString();
     return name;
 }