MAINEDIT User's Guide, Appendix C

previous   next   top   contents   index   framed top   this page unframed


C. Key Code Program

The program below allows the user of a display module to determine which character codes the display module returns for which keystrokes. This is sometimes useful, e.g., in conjunction with the MAINVI :mapcode and :mapcode! commands.

The easiest way to run this program is to use a text editor to copy it from the online version of this manual, modifying it if necessary to remove any extraneous characters introduced by the document formatter.

BEGIN "keyCod"

REDEFINE $scanName = "dpyHdr"; SOURCEFILE "(system library)";

INITIAL PROCEDURE;
BEGIN
BOOLEAN mapped;
INTEGER ch,row;
POINTER(dpyClsdpy;
mapped := confirm("Y for mapped key codesN for unmapped");
dpy := new($sGet("Display module: "));
dpy.initializeTerminaldpy.clearScreen;
row := 0;
DOB ch := IF mapped THEN dpy.dpycRead EL dpy.unmappedDpycRead;
    
dpy.setCursorOnScreen(row,0);
    
IF row .+ 1 > dpy.lastRowOfScreen THENB
        
dpy.clearScreenrow := 0 END;
    
dpy.overstrikeChars(cvs(ch)) END UNTIL ch = 'qOR ch = 'Q';
dpy.deInitializeTerminal;
dispose(dpy);
END;

END "keyCod"

previous   next   top   contents   index   framed top   this page unframed

MAINEDIT User's Guide, Appendix C