public void InvokeCursorMove(Vector2 cursorPosition, Vector2 previousCursorPosition, bool isCursorDown) { var relativeNew = (cursorPosition - RenderPosition).ToPoint(); var relativeOld = (previousCursorPosition - RenderPosition).ToPoint(); CursorMove?.Invoke(this, new GuiCursorMoveEventArgs(relativeNew, relativeOld, isCursorDown)); OnCursorMove(relativeNew, relativeOld, isCursorDown); }
protected virtual bool HideCusor(ConsoleKeyInfo keyInfo) { if (CursorPosition == null) { return(false); } var old = CursorPosition; CursorPosition = null; var args = new CursorInformation(old, CursorPosition, keyInfo); return(CursorMove?.Invoke(this, args) ?? true); }
protected virtual bool CursorUp(ConsoleKeyInfo keyInfo) { if (CursorPosition == null) { CursorPosition = _windows.Skip(_page * ITEMS_PER_PAGE).Take(ITEMS_PER_PAGE) .Count(); } if (CursorPosition <= 0) { return(false); } var old = CursorPosition--; var args = new CursorInformation(old, CursorPosition, keyInfo); return(CursorMove?.Invoke(this, args) ?? true); }