In order for applications to receive all keyboard inputs, including the
Ctrl-C and Ctrl-Z, the raw input mode has been enabled. As result the
SIGINT will no longer be used, instead the keyboard Ctrl-C event is used
for exiting the framework, but only if no components has made use of it.
Co-authored-by: Jørn Gustav Larsen <jgl@fasttracksoftware.com>
Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
When moving the cursor back to its original location, a problem arises when cursor placed in the right edge column, where an off by one error occur. This pull request will resolve this problem.
Co-authored-by: Jørn Gustav Larsen <jgl@fasttracksoftware.com>
Co-authored-by: Jørn Gustav Larsen <jgl@adminbyrequest.com>
Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
Some users might destroy `this`, which would result in UAF.
In the future, we should consider alternatives like posting a task to
the main loop, or rely on users for this.
Fixed:https://github.com/ArthurSonzogni/FTXUI/issues/804
This should solve #766
The original PR was:
#767
Co-authored-by: rbrugo <brugo.riccardo@gmail.com>
Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
This fixes: https://github.com/ArthurSonzogni/FTXUI/issues/773
Dragging the mouse with the left button pressed now avoids activating multiple
checkboxes.
Add support for detecting mouse press transition. Added:
```cpp
// The previous mouse event.
Mouse Mouse::previous;
// Return whether the mouse transitionned from:
// released to pressed => IsPressed()
// pressed to pressed => IsHeld()
// pressed to released => IsReleased()
bool Mouse::IsPressed(Button button) const;
bool Mouse::IsHeld(Button button) const;
bool Mouse::IsReleased(Button button) const;
```
A couple of components are now activated when the mouse is pressed,
as opposed to released.
Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
We update the lock on the nix flake and also add a dev shell. This means
you can do `nix build` to build the project and `nix develop` to drop
into a development environment with cmake and clang.
Signed-off-by: Ali Caglayan <alizter@gmail.com>
Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
This a proposed MR to fix#754. While building the scroll bar the pixels were completely reseted thus canceling any style previously applied to said pixels. This MR removes this resetting of the pixels and leaves only the drawing of the shape of the scroll bar.
When mouse events are enabled, it is not possible to select text in the
terminal and copy it somewhere else. This could be usefull for some
applications if they don't need to handle mouse events.
Add a function on the ScreenInteractive class to disable grabbing of
mouse events so that it is e.g. possible to select text in the user
interface. The function needs to be called on the screen object before
starting the application loop if such a behaviour is desired.