Restore cursor shape on exit. (#793) (#794)

Fixed: https://github.com/ArthurSonzogni/FTXUI/issues/792
This commit is contained in:
Arthur Sonzogni
2023-12-17 10:35:21 +01:00
committed by GitHub
parent 348c3853d4
commit a7b6785420
17 changed files with 96 additions and 90 deletions

View File

@@ -21,13 +21,9 @@ struct Mouse {
enum Motion {
Released = 0,
Pressed = 1,
Moved = 2,
};
// Utility function to check the variations of the mouse state.
bool IsPressed(Button btn = Left) const; // Released => Pressed.
bool IsHeld(Button btn = Left) const; // Pressed => Pressed.
bool IsReleased(Button btn = Left) const; // Pressed => Released.
// Button
Button button = Button::None;
@@ -42,9 +38,6 @@ struct Mouse {
// Coordinates:
int x = 0;
int y = 0;
// Previous mouse event, if any.
Mouse* previous = nullptr;
};
} // namespace ftxui

View File

@@ -117,7 +117,6 @@ class ScreenInteractive : public Screen {
// The style of the cursor to restore on exit.
int cursor_reset_shape_ = 1;
Mouse latest_mouse_event_;
friend class Loop;
public: