In order for this site to work correctly, and for us to improve the site, we need to store a small file (called a cookie) on your computer.
By continuing to use this website, you agree to our cookies and privacy policy.
  
Home page Home page Home page Home page
Pixel
Pixel Header R1 C1 Pixel
Pixel Header R2 C1 Pixel
Pixel Header R3 C1 Pixel
Pixel

Uncommon Knowledge - WC_Soft_Keys%

A field mark delimited list of scan codes associated with the softkeys for the window. Upon return from SCRIBE (or the replace SCRIBE process if nominated), the first thing that the window processor tries to do is to locate the last key pressed in WC_Soft_Keys%. If it succeeds it will call the appropriate catalyst code and command, failing that it will try to locate the keystroke in the window specific keys in @Int.Const, then the general editing keys in @Move.Keys etc.

Note that although the PAINT processor expects the developer to use a scan code for SF1-10 or AF1-10 here, the developer may replace the scan code for the function key with the scan code for ANY key other than those trapped in INPUT.CHAR (i.e. those in @PRIORITY.INT). This may be done programmatically on a post initialise, or using the editor and modifying the scan codes directly in the template record.

Due to this it is possible to have as many soft keys for a window as you wish to define, just ensure that the scan codes are in WC_Soft_Keys% and that a corresponding code and command is in WC_Soft_Data%. Note though that whilst this will always work if the Soft Key is called from the F6 popup, it will not always work if the key is pressed directly. To understand why this is the case it is necessary to understand how the SCRIBE/WINDOW combination works. When WINDOW calls SCRIBE it passes a list of keys (in WC_WExit_Keys%) which ought to cause SCRIBE to return control to the WINDOW processor. This list is constructed at initialisation from @INT.CONST, some of @MOVE.KEYS, WC_Soft_Keys%, WC_Related_Keys% and it would seem, a hard coded Alt-C (for copy record). When one of these keys is pressed, control is returned to Window and Window works out what to do.

If Scan Codes have been added programmatically into Soft_Keys AND THEY WERE NOT PREVIOUSLY IN THE ORIGINAL WC_WEXIT_KEYS% then they will not cause SCRIBE to exit and will thus never be recognised. Thus WC_WEXIT_KEYS% must be updated to contain any new Scan Codes added to WC_Soft_Keys%.

NB - The Variable is called WC_WEXIT_KEYS% not WC_EXIT_KEYS% as might at first seem appropriate.

Thus to make the F9 key call a user defined subroutine instead of saving the window, the following post initialise process could be used (NB this code assumes that no Softkeys have previously been defined for the window - it will overwrite them if they have) ;


0001    Subroutine Reassign_F9
0002      $insert INCLUDE, WINDOW_COMMON%
0003      WC_Soft_Keys% = char(0) : char(67)
0004      WC_Soft_Data% = ""
0005      WC_Soft_Data%<1,3> = "S"
0006      WC_Soft_Data%<1,4> = "REP_SAVE"
0007    Return

To make Alt-L call a user defined subroutine, the post initialise process would need to be changed as follows ;


0001    Subroutine Reassign_Alt_L
0002      $insert INCLUDE, WINDOW_COMMON%
0003      WC_Soft_Keys% = char(0) : char(38)
0004      WC_Soft_Data% = ""
0005      WC_Soft_Data%<1,3> = "S"
0006      WC_Soft_Data%<1,4> = "REP_ALT_L"
0007      WC_WExit_Keys%<-1> = char(0) : char(38)
0008    Return

(Volume 3, Issue 9, Pages 13,14)
Pixel
Pixel Footer R1 C1 Pixel
Pixel
Pixel
Pixel