$TITLE('FmTabKey.Asm V061A M01 === 061788')

NAME Fmtabkey

DATA     SEGMENT WORD PUBLIC 'DATA'
VERSION_MODULE  DB      '061A01'
DATA     ENDS

;******************************* MODULE HEADER ******************************;
;*									    *;
;*									    *;
;* MACHINE: B20		LANGUAGE: ASSEMBLER  OS: BTOS			    *;
;*									    *;
;* DESCRIPTION:								    *;
;*									    *;
;*			SEE COMMENTS BELOW				    *;
;*									    *;
;*									    *;
;*									    *;
;*									    *;
;*									    *;
;*									    *;
;* HISTORY:								    *;
;*									    *;
;* MMDDYY VVVVMM PROGRAMMER     DESCRIPTION	   (Most recent first)      *;
;*									    *;
;* 061788 061A01 R. FARHANG     Single file to provide keyboard         *;
;*                                 definition table for both 4.0 and 5.0   *;
;*                                 functionality.                          *;
;*									    *;
;* 091187 060G01 R. FARHANG     Complete key table 4.0 functionality    *;
;*									    *;
;* 072287 060B01 R. FARHANG     Provide Forms 4.0 functionality         *;
;*									    *;
;* 062987 060A01 M. JUNGWIRTH   Corrected corrupted code.		    *;
;*									    *;
;* 020587 060A01 M. JUNGWIRTH   Change func. keys (F1F10) to NEXT.	    *;
;*									    *;
;* 072886 051A01 M. JUNGWIRTH   Add FORMSB changes.		    *;
;*									    *;
;*									    *;
;*									    *;
;* TITLE:  B20 SYSTEM SOFTWARE						    *;
;*									    *;
;*			PROPRIETARY PROGRAM MATERIAL			    *;
;*									    *;
;* THIS MATERIAL IS PROPRIETARY TO UNISYS CORPORATION AND IS NOT TO BE	    *;
;* REPRODUCED, USED OR DISCLOSED EXCEPT IN ACCORDANCE WITH PROGRAM LICENSE  *;
;* OR UPON WRITTEN AUTHORIZATION OF THE PATENT DIVISION OF UNISYS	    *;
;* CORPORATION, DETROIT, MICHIGAN 48232, USA.				    *;
;*									    *;
;* COPYRIGHT (C) 1980 CONVERGENT TECHNOLOGIES, INC. ALL RIGHTS RESERVED     *;
;* COPYRIGHT (C) 1987 UNISYS CORPORATION		                    *;
;* ************************************************************************ *;
;*									    *;
;* UNISYS BELIEVES THAT THE SOFTWARE FURNISHED HEREWITH IS ACCURATE AND     *;
;* RELIABLE, AND MUCH CARE HAS BEEN TAKEN IN ITS PREPARATION.  HOWEVER,     *;
;* NO RESPONSIBILITY, FINANCIAL OR OTHERWISE, CAN BE ACCEPTED FOR ANY       *;
;* CONSEQUENCES ARISING OUT OF THE USE OF THIS MATERIAL, INCLUDING LOSS OF  *;
;* PROFIT, INDIRECT, SPECIAL, OR CONSEQUENTIAL DAMAGES, THERE ARE NO        *;
;* WARRANTIES WHICH EXTEND BEYOND THE PROGRAM SPECIFICATION.		    *;
;*									    *;
;* THE CUSTOMER SHOULD EXERCISE CARE TO ASSURE THAT USE OF THE SOFTWARE     *;
;* WILL BE IN FULL COMPLIANCE WITH LAWS, RULES AND REGULATIONS OF THE       *;
;* JURISDICTIONS WITH RESPECT TO WHICH IT IS USED.			    *;
;*									    *;
;*									    *;
;*************************** END OF MODULE HEADER ***************************;
;
;                                                                            
;  File FmTabKey.asm                                                         
;  =================                                                         
;                                                                            
;    Contains the table used by the Forms RunTime to determine the type of  
;    each key pressed by the operator.                                       
;    Each key can be:                                                        
;         a function key:                                                   
;            .Next field;                                                    
;            .Previous field;                                                
;            .Validation (of the whole filledin form);                      
;            .Cancel (the whole filledin form);                             
;            .Correction (of an operator error);                             
;            .Illegal;                                                       
;            .Next value;                                                    
;            .Previous value;                                                
;            .First field;                                                   
;            .Last field.                                                    
;         a data key:                                                       
;            .Numeric;                                                       
;            .Alphabetic;                                                    
;            .Alphanumeric;                                                  
;            .Text.                                                          
;    These key definitions can be modified to meet the requirements of a     
;    specific user application.                                              
;                                                                            
;    FmTabKey.asm file also contains the definition of the decimal mark      
;    (period or comma) to be used in fields with decimal justification.      
;                                                                            
;

PUBLIC		TabKey
PUBLIC		fCorr,chDecimalMark

DGroup		GROUP		Const
ASSUME		DS:DGroup

CONST		SEGMENT	WORD PUBLIC 'Const'

TRUE		EQU	0FFh
FALSE		EQU	00h

;
;                                                                            
;    Definition of the flags used in TabKey table.                           
;    DO NOT MODIFY.                                                          
;                                                                            
;

Function	EQU	80h;	Function Key

Illegal   	EQU	00h;	Illegal
FirstField      EQU     01h;    First Field
LastField       EQU     02h;    Last Field
NextVal         EQU     09h;    Next Value
PreviousVal     EQU     0Ah;    Previous Value
Correction	EQU	0fh;	Correction Function Key
Next     	EQU	10h;	Next Field
Previous	EQU	20h;	Previous Field
Validation	EQU	30h;	Validates filledin form
Cancel  	EQU	40h;	Cancels filledin form

Tx		EQU	01h;	Text character
An		EQU	02h;	Alphanumeric character
Ab		EQU	04h;	Alphabetic character
Nu		EQU	08h;	Numeric character

;
;                                                                            
;    Definition of the decimal mark.                                         
;    Can be either period (2Eh) or comma (2Ch).                              
;    DO NOT CHANGE THE NAME 'chDecimalMark'.                                 
;                                                                            
;

chDecimalMark	DB	2Eh

;
;                                                                            
;    The flag 'fCorr' below indicates if any correction key must be used.    
;                                                                            
;    fCorr = TRUE means that, after an operator error, the error message will
;    be erased and the keyboard unlocked only by pressing a correction       
;    function key.                                                           
;                                                                            
;    fCorr = FALSE means that the first valid key entered after an operator  
;    error will be processed normally and will reset the error condition.    
;                                                                            
;    IF fCorr IS SET TO TRUE, MAKE SURE THERE IS AT LEAST ONE CORRECTION     
;    FUNCTION KEY DEFINED IN TabKey TABLE.                                   
;                                                                            
;

fCorr		DB	FALSE

;
;                                                                            
;  TabKey table:                                                             
;                                                                            
;    256byte table indexed by the ASCII code associated with the key.       
;    Each byte contains a set of flags defining the type of the related key. 
;                                                                            
;    The only valid combinations are:                                        
;         Function+Next;                                                    
;         Function+Previous;                                                
;         Function+Validation;                                              
;         Function+Cancel;                                                  
;         Function+Correction;                                              
;         Function+Illegal;                                                 
;         Function+NextVal;                                                 
;         Function+PreviousVal;                                             
;         Function+FirstField;                                              
;         Function+LastField;                                               
;         Any combination of Tx, An, Ab and Nu.                             
;                                                                            
;    Function+Correction has meaning only if flag fCorr is set to TRUE.      
;                                                                            
;    Keys for which table entry is null can be entered only by literal       
;    insertion (codequote).                                                 
;    ASCII codes between 00 and 03 cannot be used as data characters.        
;                                                                            
;

Tabkey	LABEL	BYTE

DB	Function+Validation		;	(00) Help	 * 060B01 *
DB	Function+Previous		;	(01) Up Arrow
DB	Function+Validation		;	(02) Mark  	 * 060B01 *
DB	Function+Validation		;	(03) Shift6
DB	Function+Validation		;	(04) Finish	 * 060B01 *
DB	Function+Validation		;	(05) Prev Page
DB	Tx+An				;	(06) 12
DB	Function+Cancel			;	(07) Cancel
DB	Function+Validation		;	(08) Backspace
DB	Function+Next  			;	(09) Tab
DB	Function+Next			;	(0A) Return  Next
DB	Function+Next 			;	(0B) Down Arrow
DB	Function+Validation		;	(0C) Next Page
DB	Function+Validation		;	(0D) Bound	* 060B01 *
DB	Function+Validation		;	(0E) Left Arrow
DB	Function+Validation		;	(0F) Move	* 060B01 *
DB	Tx+An				;	(10) Shift12
DB	Function+NextVal		;	(11) Scroll up
DB	Function+Validation		;	(12) Right Arrow
DB	Function+PreviousVal		;	(13) Scroll down
DB	Function+Validation		;	(14) Copy	* 060B01 *
DB	Function+Validation		;	(15) F1
DB	Function+Validation		;	(16) F2
DB	Function+Validation		;	(17) F3
DB	Function+Validation		;	(18) F4
DB	Function+Validation		;	(19) F5
DB	Function+Validation		;	(1A) F6
DB	Function+Validation		;	(1B) GO
DB	Function+Validation		;	(1C) F7
DB	Function+Validation		;	(1D) F8
DB	Function+Validation		;	(1E) F9
DB	Function+Validation		;	(1F) F10
DB	Tx+An				;	(20) Space
DB	Tx+An				;	(21) 
DB	Tx+An				;	(22) 
DB	Tx+An				;	(23) 
DB	Tx+An				;	(24) $
DB	Tx+An				;	(25) Shift5
DB	Tx+An				;	(26) Shift7
DB	Tx+An				;	(27) '
DB	Tx+An				;	(28) (
DB	Tx+An				;	(29) )
DB	Tx+An				;	(2A) *
DB	Tx+An+Nu			;	(2B) +
DB	Tx+An				;	(2C) ,
DB	Tx+An+Nu			;	(2D) 
DB	Tx+An				;	(2E) .
DB	Tx+An				;	(2F) 
DB	Tx+An+Nu			;	(30) 0
DB	Tx+An+Nu			;	(31) 1
DB	Tx+An+Nu			;	(32) 2
DB	Tx+An+Nu			;	(33) 3
DB	Tx+An+Nu			;	(34) 4
DB	Tx+An+Nu			;	(35) 5
DB	Tx+An+Nu			;	(36) 6
DB	Tx+An+Nu			;	(37) 7
DB	Tx+An+Nu			;	(38) 8
DB	Tx+An+Nu			;	(39) 9
DB	Tx+An				;	(3A) :
DB	Tx+An				;	(3B) ;
DB	Tx+An				;	(3C) <
DB	Tx+An				;	(3D) =
DB	Tx+An				;	(3E) >
DB	Tx+An				;	(3F) ?
DB	Tx+An				;	(40) @
DB	Tx+An+Ab			;	(41) A
DB	Tx+An+Ab			;	(42) B
DB	Tx+An+Ab			;	(43) C
DB	Tx+An+Ab			;	(44) D
DB	Tx+An+Ab			;	(45) E
DB	Tx+An+Ab			;	(46) F
DB	Tx+An+Ab			;	(47) G
DB	Tx+An+Ab			;	(48) H
DB	Tx+An+Ab			;	(49) I
DB	Tx+An+Ab			;	(4A) J
DB	Tx+An+Ab			;	(4B) K
DB	Tx+An+Ab			;	(4C) L
DB	Tx+An+Ab			;	(4D) M
DB	Tx+An+Ab			;	(4E) N
DB	Tx+An+Ab			;	(4F) O
DB	Tx+An+Ab			;	(50) P
DB	Tx+An+Ab			;	(51) Q
DB	Tx+An+Ab			;	(52) R
DB	Tx+An+Ab			;	(53) S
DB	Tx+An+Ab			;	(54) T
DB	Tx+An+Ab			;	(55) U
DB	Tx+An+Ab			;	(56) V
DB	Tx+An+Ab			;	(57) W
DB	Tx+An+Ab			;	(58) X
DB	Tx+An+Ab			;	(59) Y
DB	Tx+An+Ab			;	(5A) Z
DB	Tx+An				;	(5B) [
DB	Tx+An				;	(5C) \
DB	Tx+An				;	(5D) ]
DB	Tx+An				;	(5E) ^
DB	Tx+An				;	(5F) _
DB	Tx+An				;	(60) 
DB	Tx+An+Ab			;	(61) a
DB	Tx+An+Ab			;	(62) b
DB	Tx+An+Ab			;	(63) c
DB	Tx+An+Ab			;	(64) d
DB	Tx+An+Ab			;	(65) e
DB	Tx+An+Ab			;	(66) f
DB	Tx+An+Ab			;	(67) g
DB	Tx+An+Ab			;	(68) h
DB	Tx+An+Ab			;	(69) i
DB	Tx+An+Ab			;	(6A) j
DB	Tx+An+Ab			;	(6B) k
DB	Tx+An+Ab			;	(6C) l
DB	Tx+An+Ab			;	(6D) m
DB	Tx+An+Ab			;	(6E) n
DB	Tx+An+Ab			;	(6F) o
DB	Tx+An+Ab			;	(70) p
DB	Tx+An+Ab			;	(71) q
DB	Tx+An+Ab			;	(72) r
DB	Tx+An+Ab			;	(73) s
DB	Tx+An+Ab			;	(74) t
DB	Tx+An+Ab			;	(75) u
DB	Tx+An+Ab			;	(76) v
DB	Tx+An+Ab			;	(77) w
DB	Tx+An+Ab			;	(78) x
DB	Tx+An+Ab			;	(79) y
DB	Tx+An+Ab			;	(7A) z
DB	Tx+An				;	(7B) {
DB	Tx+An				;	(7C) |
DB	Tx+An				;	(7D) }
DB	Tx+An				;	(7E) 
DB	Function+Validation		;	(7F) Delete
DB	Function+Validation		;	(80) CodeHelp
DB	Function+FirstField		;	(81) CodeUp Arrow
DB	Function+Validation		;	(82) CodeMark
DB	Function+Validation		;	(83) CodeShift6
DB	Function+Validation		;	(84) CodeFinish
DB	Function+Validation		;	(85) CodePrevious Page
DB	Function+Validation		;	(86) Code12
DB	Function+Validation		;	(87) CodeCancel
DB	Function+Validation		;	(88) CodeBackspace
DB	Function+Validation		;	(89) CodeTab
DB	Function+Validation		;	(8A) CodeReturn
DB	Function+LastField		;	(8B) CodeDown Arrow
DB	Function+Validation		;	(8C) CodeNext Page
DB	Function+Validation		;	(8D) CodeBound
DB	Function+Validation		;	(8E) CodeLeft Arrow
DB	Function+Validation		;	(8F) CodeMove
DB	Function+Validation		;	(90) CodeShift12
DB	Function+Validation		;	(91) CodeScroll up
DB	Function+Validation		;	(92) CodeRight Arrow
DB	Function+Validation		;	(93) CodeScroll down
DB	Function+Validation		;	(94) CodeCopy
DB	Function+Validation		;	(95) CodeF1
DB	Function+Validation		;	(96) CodeF2
DB	Function+Validation		;	(97) CodeF3
DB	Function+Validation		;	(98) CodeF4
DB	Function+Validation		;	(99) CodeF5
DB	Function+Validation		;	(9A) CodeF6
DB	Function+Validation		;	(9B) CodeGO
DB	Function+Validation		;	(9C) CodeF7
DB	Function+Validation		;	(9D) CodeF8
DB	Function+Validation		;	(9E) CodeF9
DB	Function+Validation		;	(9F) CodeF10
DB	Tx+An				;	(A0) CodeEspace
DB	Tx+An				;	(A1) CodeShift1
DB	Tx+An				;	(A2) CodeShift'
DB	Tx+An				;	(A3) CodeShift3
DB	Tx+An				;	(A4) CodeShift4
DB	Tx+An				;	(A5) CodeShift5
DB	Tx+An				;	(A6) CodeShift7
DB	Tx+An				;	(A7) Code'
DB	Tx+An				;	(A8) CodeShift9
DB	Tx+An				;	(A9) CodeShift0
DB	Tx+An				;	(AA) CodeShift8
DB	Tx+An				;	(AB) CodeShift=
DB	Tx+An				;	(AC) Code,
DB	Tx+An				;	(AD) Code
DB	Tx+An				;	(AE) Code.
DB	Tx+An				;	(AF) Code
DB	Tx+An				;	(B0) Code0
DB	Tx+An				;	(B1) Code1
DB	Tx+An				;	(B2) Code2
DB	Tx+An				;	(B3) Code3
DB	Tx+An				;	(B4) Code4
DB	Tx+An				;	(B5) Code5
DB	Function+Validation		;	(B6) Code6
DB	Function+Validation		;	(B7) Code7
DB	Function+Validation		;	(B8) Code8
DB	Function+Validation		;	(B9) Code9
DB	Function+Validation		;	(BA) CodeShift;
DB	Function+Validation		;	(BB) Code;
DB	Function+Validation		;	(BC) CodeShift[
DB	Function+Validation		;	(BD) Code=
DB	Function+Validation		;	(BE) CodeShift]
DB	Function+Validation		;	(BF) CodeShift
DB	Function+Validation		;	(C0) CodeShift2
DB	Function+Validation		;	(C1) CodeShifta
DB	Function+Validation		;	(C2) CodeShiftb
DB	Function+Validation		;	(C3) CodeShiftc
DB	Function+Validation		;	(C4) CodeShiftd
DB	Function+Validation		;	(C5) CodeShifte
DB	Function+Validation		;	(C6) CodeShiftf
DB	Function+Validation		;	(C7) CodeShiftg
DB	Function+Validation		;	(C8) CodeShifth
DB	Function+Validation		;	(C9) CodeShifti
DB	Function+Validation		;	(CA) CodeShiftj
DB	Function+Validation		;	(CB) CodeShiftk
DB	Function+Validation		;	(CC) CodeShiftl
DB	Function+Validation		;	(CD) CodeShiftm
DB	Function+Validation		;	(CE) CodeShiftn
DB	Function+Validation		;	(CF) CodeShifto
DB	Function+Validation		;	(D0) CodeShiftp
DB	Function+Validation		;	(D1) CodeShiftq
DB	Function+Validation		;	(D2) CodeShiftr
DB	Function+Validation		;	(D3) CodeShifts
DB	Function+Validation		;	(D4) CodeShiftt
DB	Function+Validation		;	(D5) CodeShiftu
DB	Function+Validation		;	(D6) CodeShiftv
DB	Function+Validation		;	(D7) CodeShiftw
DB	Function+Validation		;	(D8) CodeShiftx
DB	Function+Validation		;	(D9) CodeShifty
DB	Function+Validation		;	(DA) CodeShiftz
DB	Function+Validation		;	(DB) Code[
DB	Function+Validation		;	(DC) CodeShiftnum 8
DB	Function+Validation		;	(DD) Code]
DB	Function+Validation		;	(DE) Code
DB	Function+Validation		;	(DF) CodeShift
DB	Function+Validation		;	(E0) CodeShiftnum 1
DB	Function+Validation		;	(E1) Codea
DB	Function+Validation		;	(E2) Codeb
DB	Function+Validation		;	(E3) Codec
DB	Function+Validation		;	(E4) Coded
DB	Function+Validation		;	(E5) Codee
DB	Function+Validation		;	(E6) Codef
DB	Function+Validation		;	(E7) Codeg
DB	Function+Validation		;	(E8) Codeh
DB	Function+Validation		;	(E9) Codei
DB	Function+Validation		;	(EA) Codej
DB	Function+Validation		;	(EB) Codek
DB	Function+Validation		;	(EC) Codel
DB	Function+Validation		;	(ED) Codem
DB	Function+Validation		;	(EE) Coden
DB	Function+Validation		;	(EF) Codeo
DB	Function+Validation		;	(F0) Codep
DB	Function+Validation		;	(F1) Codeq
DB	Function+Validation		;	(F2) Coder
DB	Function+Validation		;	(F3) Codes
DB	Function+Validation		;	(F4) Codet
DB	Function+Validation		;	(F5) Codeu
DB	Function+Validation		;	(F6) Codev
DB	Function+Validation		;	(F7) Codew
DB	Function+Validation		;	(F8) Codex
DB	Function+Validation		;	(F9) Codey
DB	Function+Validation		;	(FA) Codez
DB	Function+Validation		;	(FB) CodeShiftnum 4
DB	Function+Validation		;	(FC) CodeShiftnum 7
DB	Function+Validation		;	(FD) CodeShiftnum 5
DB	Function+Validation		;	(FE) CodeShift
DB	Function+Validation		;	(FF) CodeDelete


CONST	ENDS

END
(7E) 
DB	Function+Validation		;	(7F) Delete
DB	Function+Validation		;	(80) CodeHelp
DB	Function+FirstField		;	(81) CodeUp Arrow
DB	Function+Validation		;	(82) CodeMark
DB	Function+Validation		;	(83) CodeShift6
DB	Function+Validation		;	(84) CodeFinish
DB	Function+Validation		;	(85) CodePrevious Page
DB	Function+Validation		;	(86) Code12
DB	Function+Validation		;	(87) CodeCancel
DB	Function+Validation		;	(88) CodeBackspace
DB	Function+Validation		;	(89) CodeTab
DB	Functi