<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hello,<br>
<br>
Le 25/06/2014 22:08, Fahrni Pascal (fahn) a écrit :<br>
</div>
<blockquote
cite="mid:83D0B391F6E5B6479C08794764094D743BC5D8E2@srv-mail-111.zhaw.ch"
type="cite">
<div class="WordSection1">
<p class="MsoNormal">Dear scilab users,<o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-AU">I’m using a scilab
script to monitor a serial port, read from it and do some
calculations based on that data. The program is wrapped by a
while loop and contains an xpause statement. What is the
best way to allow the user to terminate the program by user
input?</span></p>
</div>
</blockquote>
This is an untested proposal: create a virtual figure and use its
event handler sensitive to on-the-flight keyboard events:<br>
* create a figure<br>
* set its .visible property to "off"<br>
* set properly its .event_handler and its event_handler_enable
properties<br>
* in the event handler function: catch the code of the event; if
it's a keyboard event (or a specific one that you require from the
user), issue an abort instruction;<br>
<br>
HTH<br>
Samuel<br>
</body>
</html>