示例#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;
 }