mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-15 23:48:15 +08:00
Add a TrackMouse(false) on ScreenInteractive to disable mouse events (#726)
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.
This commit is contained in:

committed by
GitHub

parent
f7304c28c3
commit
b3f1edc385
@@ -31,6 +31,9 @@ class ScreenInteractive : public Screen {
|
||||
static ScreenInteractive FitComponent();
|
||||
static ScreenInteractive TerminalOutput();
|
||||
|
||||
// Options. Must be called before Loop().
|
||||
void TrackMouse(bool enable = true);
|
||||
|
||||
// Return the currently active screen, nullptr if none.
|
||||
static ScreenInteractive* Active();
|
||||
|
||||
@@ -84,6 +87,8 @@ class ScreenInteractive : public Screen {
|
||||
Dimension dimension,
|
||||
bool use_alternative_screen);
|
||||
|
||||
bool track_mouse_= true;
|
||||
|
||||
Sender<Task> task_sender_;
|
||||
Receiver<Task> task_receiver_;
|
||||
|
||||
|
Reference in New Issue
Block a user