DIR0K ;SFISC/MKO-GET KEYS FOR FIELD EDITOR ;29APR2012
;;22.2;VA FileMan;;Jan 05, 2016;Build 42
;;Per VA Directive 6402, this routine should not be modified.
;;Submitted to OSEHRA 5 January 2015 by the VISTA Expertise Network.
;;Based on Medsphere Systems Corporation's MSC FileMan 1051.
;;Licensed under the terms of the Apache License, Version 2.0.
;
GETKEY ;Get key sequences
N AU,AD,AR,AL,F1,F2,F3,F4,I,K,T
N REMOVE,PREVSC,NEXTSC
S AU=$P(DDGLKEY,U,2)
S AD=$P(DDGLKEY,U,3)
S AR=$P(DDGLKEY,U,4)
S AL=$P(DDGLKEY,U,5)
S F1=$P(DDGLKEY,U,6)
S F2=$P(DDGLKEY,U,7)
S F3=$P(DDGLKEY,U,8)
S F4=$P(DDGLKEY,U,9)
S REMOVE=$P(DDGLKEY,U,13)
S PREVSC=$P(DDGLKEY,U,14)
S NEXTSC=$P(DDGLKEY,U,15)
;
S DIR0(DIR0P_"IN")="",DIR0(DIR0P_"OUT")=""
;
NOMOUSE N NOMOUSE I $G(^XTV(8989.5,0))?1"PARAM".E,$$GET^XPAR("ALL","DI SCREENMAN NO MOUSE") S NOMOUSE=1 ;DISABLE MOUSE CLICKS
I DIR0P="C" S I="" F S I=$O(DIR0MAP(I)) Q:I'=+$P(I,"E") S T=DIR0MAP(I) D INOUT
F I=1:1 S T=$P($T(GENMAP+I),";;",2,999) Q:T="" D INOUT
I DIR0P="" F I=1:1 S T=$P($T(SMMAP+I),";;",2,999) Q:T="" D INOUT
;
S DIR0(DIR0P_"IN")=DIR0(DIR0P_"IN")_U
S DIR0(DIR0P_"OUT")=$E(DIR0(DIR0P_"OUT"),1,$L(DIR0(DIR0P_"OUT"))-1)
Q
;
INOUT ;Set DIR0("IN") and DIR0("OUT")
I $P(T,";",2)="KEYDOWN" Q:$P(T,";")="" S DIR0KD=$P(T,";"),K="KD"
E I $P(T,";",2)="TIMEOUT" Q:$P(T,";")="" S DIR0TO=$P(T,";"),K="TO"
E S @("K="_$P(T,";",2)) I $G(NOMOUSE),T?1"MOUSE".E Q ;WE MAY NOT ALLOW THE THREE MOUSECLICKS
I DIR0(DIR0P_"IN")'[(U_K) D
. S DIR0(DIR0P_"IN")=DIR0(DIR0P_"IN")_U_K
. S DIR0(DIR0P_"OUT")=DIR0(DIR0P_"OUT")_$P(T,";")_";"
;
Q
GENMAP ;General field editor key sequences
;;RIGHT;AR
;;LEFT;AL
;;JRT;F1_AR
;;JLT;F1_AL
;;FDE;F1_F1_AR
;;FDB;F1_F1_AL
;;WRT;F1_" "
;;WRT;$C(12)
;;WLT;$C(10)
;;DEL;REMOVE
;;DEL;F2
;;CLR;F1_"D"
;;CLR;$C(21)
;;DEOF;F1_F2
;;DLW;$C(23)
;;CR;$C(13)
;;UP;AU
;;DOWN;AD
;;TAB;$C(9)
;;RPM;F3
;;BS;$C(127)
;;BS;$C(8)
;;MOUSE;$C(27,91,77,35)
;;MOUSEDN;$C(27,91,77,32)
;;MOUSERT;$C(27,91,77,33)
;;
SMMAP ;ScreenMan specific key sequences
;;FDL;F4
;;NB;F1_F4
;;NP;F1_AD
;;NP;NEXTSC
;;PP;F1_AU
;;PP;PREVSC
;;HLP;F1_"H"
;;SEL;F1_"L"
;;EX;F1_"E"
;;QT;F1_"Q"
;;CL;F1_"C"
;;SV;F1_"S"
;;RF;F1_"R"
;;ZM;F1_"Z"
;;PRNT;F1_"P"
;;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDIR0K 2335 printed Nov 22, 2024@18:03:48 Page 2
DIR0K ;SFISC/MKO-GET KEYS FOR FIELD EDITOR ;29APR2012
+1 ;;22.2;VA FileMan;;Jan 05, 2016;Build 42
+2 ;;Per VA Directive 6402, this routine should not be modified.
+3 ;;Submitted to OSEHRA 5 January 2015 by the VISTA Expertise Network.
+4 ;;Based on Medsphere Systems Corporation's MSC FileMan 1051.
+5 ;;Licensed under the terms of the Apache License, Version 2.0.
+6 ;
GETKEY ;Get key sequences
+1 NEW AU,AD,AR,AL,F1,F2,F3,F4,I,K,T
+2 NEW REMOVE,PREVSC,NEXTSC
+3 SET AU=$PIECE(DDGLKEY,U,2)
+4 SET AD=$PIECE(DDGLKEY,U,3)
+5 SET AR=$PIECE(DDGLKEY,U,4)
+6 SET AL=$PIECE(DDGLKEY,U,5)
+7 SET F1=$PIECE(DDGLKEY,U,6)
+8 SET F2=$PIECE(DDGLKEY,U,7)
+9 SET F3=$PIECE(DDGLKEY,U,8)
+10 SET F4=$PIECE(DDGLKEY,U,9)
+11 SET REMOVE=$PIECE(DDGLKEY,U,13)
+12 SET PREVSC=$PIECE(DDGLKEY,U,14)
+13 SET NEXTSC=$PIECE(DDGLKEY,U,15)
+14 ;
+15 SET DIR0(DIR0P_"IN")=""
SET DIR0(DIR0P_"OUT")=""
+16 ;
NOMOUSE ;DISABLE MOUSE CLICKS
NEW NOMOUSE
IF $GET(^XTV(8989.5,0))?1"PARAM".E
IF $$GET^XPAR("ALL","DI SCREENMAN NO MOUSE")
SET NOMOUSE=1
+1 IF DIR0P="C"
SET I=""
FOR
SET I=$ORDER(DIR0MAP(I))
if I'=+$PIECE(I,"E")
QUIT
SET T=DIR0MAP(I)
DO INOUT
+2 FOR I=1:1
SET T=$PIECE($TEXT(GENMAP+I),";;",2,999)
if T=""
QUIT
DO INOUT
+3 IF DIR0P=""
FOR I=1:1
SET T=$PIECE($TEXT(SMMAP+I),";;",2,999)
if T=""
QUIT
DO INOUT
+4 ;
+5 SET DIR0(DIR0P_"IN")=DIR0(DIR0P_"IN")_U
+6 SET DIR0(DIR0P_"OUT")=$EXTRACT(DIR0(DIR0P_"OUT"),1,$LENGTH(DIR0(DIR0P_"OUT"))-1)
+7 QUIT
+8 ;
INOUT ;Set DIR0("IN") and DIR0("OUT")
+1 IF $PIECE(T,";",2)="KEYDOWN"
if $PIECE(T,";")=""
QUIT
SET DIR0KD=$PIECE(T,";")
SET K="KD"
+2 IF '$TEST
IF $PIECE(T,";",2)="TIMEOUT"
if $PIECE(T,";")=""
QUIT
SET DIR0TO=$PIECE(T,";")
SET K="TO"
+3 ;WE MAY NOT ALLOW THE THREE MOUSECLICKS
IF '$TEST
SET @("K="_$PIECE(T,";",2))
IF $GET(NOMOUSE)
IF T?1"MOUSE".E
QUIT
+4 IF DIR0(DIR0P_"IN")'[(U_K)
Begin DoDot:1
+5 SET DIR0(DIR0P_"IN")=DIR0(DIR0P_"IN")_U_K
+6 SET DIR0(DIR0P_"OUT")=DIR0(DIR0P_"OUT")_$PIECE(T,";")_";"
End DoDot:1
+7 ;
+8 QUIT
GENMAP ;General field editor key sequences
+1 ;;RIGHT;AR
+2 ;;LEFT;AL
+3 ;;JRT;F1_AR
+4 ;;JLT;F1_AL
+5 ;;FDE;F1_F1_AR
+6 ;;FDB;F1_F1_AL
+7 ;;WRT;F1_" "
+8 ;;WRT;$C(12)
+9 ;;WLT;$C(10)
+10 ;;DEL;REMOVE
+11 ;;DEL;F2
+12 ;;CLR;F1_"D"
+13 ;;CLR;$C(21)
+14 ;;DEOF;F1_F2
+15 ;;DLW;$C(23)
+16 ;;CR;$C(13)
+17 ;;UP;AU
+18 ;;DOWN;AD
+19 ;;TAB;$C(9)
+20 ;;RPM;F3
+21 ;;BS;$C(127)
+22 ;;BS;$C(8)
+23 ;;MOUSE;$C(27,91,77,35)
+24 ;;MOUSEDN;$C(27,91,77,32)
+25 ;;MOUSERT;$C(27,91,77,33)
+26 ;;
SMMAP ;ScreenMan specific key sequences
+1 ;;FDL;F4
+2 ;;NB;F1_F4
+3 ;;NP;F1_AD
+4 ;;NP;NEXTSC
+5 ;;PP;F1_AU
+6 ;;PP;PREVSC
+7 ;;HLP;F1_"H"
+8 ;;SEL;F1_"L"
+9 ;;EX;F1_"E"
+10 ;;QT;F1_"Q"
+11 ;;CL;F1_"C"
+12 ;;SV;F1_"S"
+13 ;;RF;F1_"R"
+14 ;;ZM;F1_"Z"
+15 ;;PRNT;F1_"P"
+16 ;;