12.07.2015 Views

JYACC FORMAKER C Programmer's Guide Contents 1 ... - Prolifics

JYACC FORMAKER C Programmer's Guide Contents 1 ... - Prolifics

JYACC FORMAKER C Programmer's Guide Contents 1 ... - Prolifics

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

NAMESYNOPSISsm_u_play - keystroke playback hook#include "smdefs.h"extern struct fnc_data *sm_u_play;int myplay ();DESCRIPTIONThis hook is called from sm_getkey. If it returns a nonzero value, sm_getkeytreats it as an already translated logical key, which is returned to its caller.The key may be a standard displayable ASCII character, or one of the valuesdefined in smkeys.h . Normally, the returned key will have been stored in somefashion by a previous call to sm_u_record; the recording algorithm is entirelyup to you. Refer to sm_getkey for details about just when this and other inputprocessing hooks are invoked.Along with sm_u_avail and sm_u_record, this function forms part of a keystrokerecording and playback package. Such a package can be quite useful in regressiontesting and performance analysis of <strong>JYACC</strong> <strong>FORMAKER</strong> applications, because itenables you to reproduce a series of inputs exactly and with little effort.When sm_getkey obtains a key from this function, it does not update the displayfirst, as it does when reading a key from the keyboard. You may want to callsm_flush from this function or from sm_u_avail in order to keep the display insync with the input, e.g. to have data characters echoed.Note: you may call the function you supply for this hook anything you like; itis included in the manual under this head only for definiteness. In fact, thename on this page is one you should not call your function, because it willconflict with the global variable used by <strong>JYACC</strong> <strong>FORMAKER</strong> to store yourfunction's address.RETURNSAny ASCII character or <strong>JYACC</strong> <strong>FORMAKER</strong> logical key code; zero if there isnothing to play back.VARIANTS AND RELATED FUNCTIONSEXAMPLEsm_keyfilter (flag);sm_u_record (key);sm_u_avail (interval);#include "smdefs.h"#include "smerror.h"#include "smkeys.h"/* The code below forms a simple keystroke recording and playback* package, using the three hooks provided for that purpose.* Pressing PF2 causes following keystrokes to be saved in memory;* pressing PF3 stops recording keystrokes; and pressing PF4 causes* the list of saved keystrokes to be played back, with a one-second* pause between them. These transitions are done in a keychange

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!