Syntax
xBool SetCancel( int toggle );
Arguments
toggle Zero disables the setting, a nonzero value enables it, and NIL reads it without changing it.
Return value
The previous cancellation setting as T or F.
Description
Control termination through keyboard cancellation shortcuts. The input system recognizes Alt+C, and the Windows ANSI terminal driver also honors the setting for Ctrl+Break. Save the previous value when disabling cancellation around a temporary operation, then restore it.
Example
#include "xdev-wtui.h"
#include <stdio.h>
int main( void )
{
xBool previous = SetCancel( F );
printf( "Cancellation enabled: %s\n", SetCancel( NIL ) ? "yes" : "no" );
SetCancel( previous );
return 0;
}