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