예제 #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;
 }
예제 #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);
        }
예제 #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);
예제 #5
0
 public KeyFunctionId KeyFunctionID(BoundKeyFunction function)
 {
     return(KeyFunctionsMap[function]);
 }
예제 #6
0
 /// <inheritdoc />
 public void UnbindFunction(BoundKeyFunction function)
 {
     _commandBinds.Remove(function);
 }
예제 #7
0
 /// <inheritdoc />
 public bool TryGetHandler(BoundKeyFunction function, out InputCmdHandler handler)
 {
     return(_commandBinds.TryGetValue(function, out handler));
 }
예제 #8
0
 /// <inheritdoc />
 public void BindFunction(BoundKeyFunction function, InputCmdHandler command)
 {
     _commandBinds.Add(function, command);
 }
예제 #9
0
 /// <inheritdoc />
 public void RemoveFunction(BoundKeyFunction function)
 {
     _commands.Remove(function);
 }
예제 #10
0
 /// <inheritdoc />
 public bool FunctionExists(BoundKeyFunction function)
 {
     return(_commands.Contains(function));
 }
예제 #11
0
 /// <inheritdoc />
 public void AddFunction(BoundKeyFunction function)
 {
     _commands.Add(function);
 }
예제 #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;
 }