Esempio n. 1
0
 /// <summary>
 ///     Constructs a new instance of <see cref="BoundKeyEventArgs"/>.
 /// </summary>
 /// <param name="function">Bound key that that is changing.</param>
 /// <param name="state">New state of the function.</param>
 /// <param name="pointerLocation">Current Pointer location in screen coordinates.</param>
 public BoundKeyEventArgs(BoundKeyFunction function, BoundKeyState state, ScreenCoordinates pointerLocation, bool canFocus)
 {
     Function        = function;
     State           = state;
     PointerLocation = pointerLocation;
     CanFocus        = canFocus;
 }
Esempio n. 2
0
        public bool TryGetKeyFunction(KeyFunctionId funcId, out BoundKeyFunction func)
        {
            var list  = KeyFunctionsList;
            var index = (int)funcId;

            if (0 > index || index >= list.Count)
            {
                func = default;
                return(false);
            }

            func = list[index];
            return(true);
        }
Esempio n. 3
0
        /// <inheritdoc />
        public bool FunctionExistsHierarchy(BoundKeyFunction function)
        {
            if (_commands.Contains(function))
            {
                return(true);
            }

            if (_parent != null)
            {
                return(_parent.FunctionExistsHierarchy(function));
            }

            return(false);
        }
 /// <inheritdoc />
 public BoundKeyState this[BoundKeyFunction function]
 {
     get => GetState(function);
Esempio n. 5
0
 public KeyFunctionId KeyFunctionID(BoundKeyFunction function)
 {
     return(KeyFunctionsMap[function]);
 }
Esempio n. 6
0
 /// <inheritdoc />
 public void UnbindFunction(BoundKeyFunction function)
 {
     _commandBinds.Remove(function);
 }
Esempio n. 7
0
 /// <inheritdoc />
 public bool TryGetHandler(BoundKeyFunction function, out InputCmdHandler handler)
 {
     return(_commandBinds.TryGetValue(function, out handler));
 }
Esempio n. 8
0
 /// <inheritdoc />
 public void BindFunction(BoundKeyFunction function, InputCmdHandler command)
 {
     _commandBinds.Add(function, command);
 }
Esempio n. 9
0
 /// <inheritdoc />
 public void RemoveFunction(BoundKeyFunction function)
 {
     _commands.Remove(function);
 }
Esempio n. 10
0
 /// <inheritdoc />
 public bool FunctionExists(BoundKeyFunction function)
 {
     return(_commands.Contains(function));
 }
Esempio n. 11
0
 /// <inheritdoc />
 public void AddFunction(BoundKeyFunction function)
 {
     _commands.Add(function);
 }
Esempio n. 12
0
 /// <summary>
 ///     Constructs a new instance of <see cref="BoundKeyEventArgs"/>.
 /// </summary>
 /// <param name="function">Bound key that that is changing.</param>
 /// <param name="state">New state of the function.</param>
 /// <param name="pointerLocation">Current Pointer location in screen coordinates.</param>
 public BoundKeyEventArgs(BoundKeyFunction function, BoundKeyState state, ScreenCoordinates pointerLocation)
 {
     Function        = function;
     State           = state;
     PointerLocation = pointerLocation;
 }