🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3985

How to enable ctrl-break in a Standard C program

#3985
From: Bruno RICHARD
Date: Mon, 11 Sep 1995 17:06
15 lines
1157 bytes
Under DOS, if a program does not call the BIOS, for instance while doing
a loop, it is not possible for the user to send a ctrl-break.

I want to make a long loop, but still want to be able to break the
program if I want.

One way to do this is to poll the keyboard using kbhit() regularly.
The problem is that kbhit() is NOT part of the Standard C library.

Does anyone have an hint about how to do this cleanly?

_______________________________________________________________________
Bruno RICHARD                     bruno_richard@hp-france-om1.om.hp.com
 Hewlett-Packard - GPCD Lab       Phone: +33-76.62.15.38
 38053 Grenoble Cedex 9 - FRANCE  Fax:   +33-76.62.53.70
Technical Details
Message-ID: <431qar$691@isoit109.bbn.hp.com>
Path: arc1-ca.pugleaf.net!isonews.bbn.hp.com!news

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!isonews.bbn.hp.com!news
From: Bruno RICHARD <bruno_richard@hp-france-om1.om.hp.com>
Newsgroups: comp.std.c
Subject: How to enable ctrl-break in a Standard C program
Date: 11 Sep 1995 17:06:35 GMT
Organization: Hewlett-Packard
Message-ID: <431qar$691@isoit109.bbn.hp.com>
NNTP-Posting-Host: gplbrd.grenoble.hp.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 1.1N (Windows; I; 16bit)