#include "input_actions.hpp" #include namespace InputActions { void exit_success() { exit(EXIT_SUCCESS); } Callback move_cursor(const Vector2 &direction, const std::shared_ptr &cursor_controller, const std::shared_ptr &window) { return [direction, cursor_controller, window]() { constexpr int32_t amount = 1; const auto new_position = cursor_controller->where().to_direction(direction, amount); const auto window_size = window->size(); if (window_size.validate_coords(new_position) != CoordsValidation::VALID) { return; } cursor_controller->move_to(new_position); }; } } // namespace InputActions