From 6d66d5675d0fb78827bc47c49f9d4a1852c7255d Mon Sep 17 00:00:00 2001 From: HampusM Date: Wed, 8 Jun 2022 18:31:58 +0200 Subject: feat: implement command mode --- src/engine/user/cursor.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/engine/user/cursor.cpp') diff --git a/src/engine/user/cursor.cpp b/src/engine/user/cursor.cpp index d348d9e..963531f 100644 --- a/src/engine/user/cursor.cpp +++ b/src/engine/user/cursor.cpp @@ -55,6 +55,11 @@ void CursorController::ensure_position() noexcept _position = _invert_position_y(Vector2(vector2_options)); } +void CursorController::update_position(const Vector2 &position) noexcept +{ + _position = position; +} + void CursorController::hide() noexcept { fmt::print(CURSOR_INVISIBLE, fmt::arg("esc", ESC)); @@ -67,6 +72,16 @@ void CursorController::show() noexcept std::cout.flush(); } +void CursorController::set_cursor_style(CursorStyle cursor_style) noexcept +{ + fmt::print( + SET_CURSOR_STYLE, + fmt::arg("esc", ESC), + fmt::arg("style", static_cast(cursor_style))); + + std::cout.flush(); +} + void CursorController::set_bounds(const Bounds &bounds) noexcept { _bounds = bounds; -- cgit v1.2.3-18-g5258