Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Is there an Event handling when CTRL+SHIFT+C is pressed? #869

Closed
DanuulKa03 opened this issue May 28, 2024 · 2 comments
Closed

Is there an Event handling when CTRL+SHIFT+C is pressed? #869

DanuulKa03 opened this issue May 28, 2024 · 2 comments

Comments

@DanuulKa03
Copy link

I attempted to find something alike, and I only discovered Event::Special("\x03"), but this command dispatches a signal prior to sending SIGINT :(

@ArthurSonzogni
Copy link
Owner

FTXUI provides:

  static const Event a, A, CtrlA, AltA, CtrlAltA;
  static const Event b, B, CtrlB, AltB, CtrlAltB;
  static const Event c, C, CtrlC, AltC, CtrlAltC;
  static const Event d, D, CtrlD, AltD, CtrlAltD;
  static const Event e, E, CtrlE, AltE, CtrlAltE;
  static const Event f, F, CtrlF, AltF, CtrlAltF;
  static const Event g, G, CtrlG, AltG, CtrlAltG;
  static const Event h, H, CtrlH, AltH, CtrlAltH;
  static const Event i, I, CtrlI, AltI, CtrlAltI;
  static const Event j, J, CtrlJ, AltJ, CtrlAltJ;
  static const Event k, K, CtrlK, AltK, CtrlAltK;
  static const Event l, L, CtrlL, AltL, CtrlAltL;
  static const Event m, M, CtrlM, AltM, CtrlAltM;
  static const Event n, N, CtrlN, AltN, CtrlAltN;
  static const Event o, O, CtrlO, AltO, CtrlAltO;
  static const Event p, P, CtrlP, AltP, CtrlAltP;
  static const Event q, Q, CtrlQ, AltQ, CtrlAltQ;
  static const Event r, R, CtrlR, AltR, CtrlAltR;
  static const Event s, S, CtrlS, AltS, CtrlAltS;
  static const Event t, T, CtrlT, AltT, CtrlAltT;
  static const Event u, U, CtrlU, AltU, CtrlAltU;
  static const Event v, V, CtrlV, AltV, CtrlAltV;
  static const Event w, W, CtrlW, AltW, CtrlAltW;
  static const Event x, X, CtrlX, AltX, CtrlAltX;
  static const Event y, Y, CtrlY, AltY, CtrlAltY;
  static const Event z, Z, CtrlZ, AltZ, CtrlAltZ;

My terminal kitty doesn't send any key when I press CTRL + Shift + C. This is mapped to "copy".

I don't believe this is possible today to receive a different code for CTRL+C and CTRL+Shift+C, due to the current xterm specification. Terminal should send the same sequence for both:
https://superuser.com/a/722895


About overriding the default CTRL-C behavior, you can:

  • Call ScreenInteractive::ForceHandleCtrlC(false) (source)
  • Your component must "catch" the CTRL-C event, by returning true in some handler.

@DanuulKa03
Copy link
Author

Thank you for such a detailed response. This information will be very useful to me.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants