Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CTRL+C and CTRL+Break are different?

I've thought they are definitly same.
But I just found some values CTRL_C_EVENT and CTRL_BREAK_EVENT at SetConsoleCtrlhandler function.

Is there a difference?

like image 895
Benjamin Avatar asked Feb 20 '11 10:02

Benjamin


People also ask

What's Ctrl Break?

(ConTRoL-Break) In a Windows PC, holding down the Ctrl key and pressing the Break key cancels the running program or batch file. See Ctrl-C.

What happens when you type Ctrl C?

Alternatively referred to as Control+C, ^c, and C-c, Ctrl+C is a keyboard shortcut used to copy highlighted text or other object to the clipboard in a graphical user environment.

Why is Ctrl C break?

The CTRL+C key breaks into the debugger, stopping the target application or target computer, and cancels debugger commands.

Is Ctrl C the same as SIGINT?

By default, when a console window has the keyboard focus, CTRL + C or CTRL + BREAK is treated as a signal (SIGINT or SIGBREAK) and not as keyboard input.


1 Answers

See the official documentation here: CTRL+C and CTRL+BREAK Signals

I quote:

CTRL+BREAK is always treated as a signal, but an application can change the default CTRL+C behavior in two ways that prevent the handler functions from being called

like image 102
Simon Mourier Avatar answered Oct 05 '22 19:10

Simon Mourier