Support for CTRL Z

This commit is contained in:
ArthurSonzogni
2024-04-27 15:01:03 +02:00
parent 5fc51b557e
commit 2b73998d56
5 changed files with 108 additions and 17 deletions

View File

@@ -59,6 +59,15 @@ class ScreenInteractive : public Screen {
// temporarily uninstalled.
Closure WithRestoredIO(Closure);
// FTXUI implements handlers for Ctrl-C and Ctrl-Z. By default, these handlers
// are executed, even if the component catches the event. This avoid users
// handling every event to be trapped in the application. However, in some
// cases, the application may want to handle these events itself. In this case,
// the application can force FTXUI to not handle these events by calling the
// following functions with force=true.
void ForceHandleCtrlC(bool force);
void ForceHandleCtrlZ(bool force);
private:
void ExitNow();
@@ -114,6 +123,9 @@ class ScreenInteractive : public Screen {
bool frame_valid_ = false;
bool force_handle_ctrl_c_ = true;
bool force_handle_ctrl_z_ = true;
// The style of the cursor to restore on exit.
int cursor_reset_shape_ = 1;