GetKey() public static method

public static GetKey ( GlfwWindowPtr window, Key key ) : bool
window GlfwWindowPtr
key Key
return bool
Example #1
0
        public static KeyboardState GetState(GlfwWindowPtr window)
        {
            KeyboardState result = new KeyboardState();

            for (int i = 0; i < allKeys.Length; ++i)
            {
                Key k = allKeys[i];
                result.keys[k] = Glfw.GetKey(window, k);
            }

            return(result);
        }
        public static KeyboardState GetState()
        {
            KeyboardState result = new KeyboardState();

            for (char ch = '0'; ch <= '9'; ++ch)
            {
                result.chars[ch] = Glfw.GetKey(ch);
            }
            for (char ch = 'A'; ch <= 'z'; ++ch)
            {
                result.chars[ch] = Glfw.GetKey(ch);
            }
            for (int i = 0; i < allKeys.Length; ++i)
            {
                Key k = allKeys[i];
                result.keys[k] = Glfw.GetKey(k);
            }

            return(result);
        }