mist64 / cbmbasic

cbmbasic, a portable version of Commodore's version of Microsoft BASIC 6502 as found on the Commodore 64
446 stars 66 forks source link

Control+C/Control+Break should probably be handled as stop key #15

Open PhMajerus opened 2 years ago

PhMajerus commented 2 years ago

Currently, the cbmbasic.exe in interactive mode exits when Control+C or Control+Break is pressed. It would probably feel more natural, and avoid users losing their code when they're trying to program something and are trying to break back to the interactive prompt, if these keystrokes were handled by cbmbasic as equivalent to the original Stop (Run/Stop) key.

On Win32, this can be achieved by providing a handler routine to SetConsoleCtrlHandler. Be aware the routine will be called from another thread.