home *** CD-ROM | disk | FTP | other *** search
/ Global Amiga Experience / globalamigaexperience.iso / text_dtp / editor / turbotext / support / ttx_emul_vtnumpad.dfn < prev    next >
Text File  |  1995-07-10  |  7KB  |  114 lines

  1.  
  2. /** $VER: TTX_Emul_VTNumPad.dfn 2.0 (19.6.94)
  3.  **
  4.  ** This definition file and its associated ARexx macros provide keyboard
  5.  ** definitions to use the numeric keypad as if it were a keypad on DEC's line
  6.  ** of VT terminals.
  7.  **
  8.  ** This keypad emulation requires several ARexx macros to operate. These
  9.  ** macros should be present in a directory called TTX_VT located in the
  10.  ** normal TurboText:Rexx directory.
  11.  **
  12.  ** Caveats:
  13.  **  The Delete and Undelete keys are incompatible with the 'standard' key
  14.  **  definitions for those functions.  For instance, you cannot use Gold-Minus
  15.  **  to undelete what was deleted using Shift-Del.
  16.  **
  17.  **  Because of ARexx quoting conventions, undeleting text strings containing
  18.  **  quotes and/or asterisks will likely not correctly undelete the deleted
  19.  **  text.
  20.  **
  21.  **  These are interpreted macros and they require time to execute.  While not
  22.  **  excessively slow, processing of some keys may not be able to keep up with
  23.  **  rapid keystrikes.
  24.  **
  25.  ** Written by Marc A. Criley
  26.  **/
  27.  
  28.  
  29. KEYBOARD: APPEND
  30.  
  31.   NUM_PAD-(              SetMeta
  32.   NUM_PAD-)              Help FILE TurboText:Support/TTX_Help_VTNumPad.guide
  33.  
  34.   NUM_PAD-/              ExecARexxString "SetPrefs FindBackward OFF; Find; IF RC ~= 0 THEN SetStatusBar Temporary 'Not found!'"
  35.   MODE-NUM_PAD-/         ExecARexxString "SetPrefs FindBackward ON; Find; IF RC ~= 0 THEN SetStatusBar Temporary 'Not found!'"
  36.   META-NUM_PAD-/         ExecARexxString "SetPrefs FindBackward OFF; OpenRequester Find"
  37.   MODE-META-NUM_PAD-/    ExecARexxString "SetPrefs FindBackward ON; OpenRequester Find"
  38.  
  39.   NUM_PAD-*              ExecARexxString "options results; GetCursorPos; Parse Var Result Line Column .; GetLine Column; Result = Setclip('TTXVTDelLine', '22'x || Result || '0A'x || '22'x); DeleteEOL; Delete"
  40.   META-NUM_PAD-*         ExecARexxMacro LockDisplay TurboText:Rexx/TTX_VT/Meta_KP_Star.ttx
  41.   MODE-META-NUM_PAD-*    ExecARexxMacro LockDisplay TurboText:Rexx/TTX_VT/Meta_KP_Star.ttx
  42.  
  43.   NUM_PAD-0              ExecARexxString "MoveSOL; MoveDown"
  44.   MODE-NUM_PAD-0         ExecARexxString "options results; GetCursorPos; CP = Result; MoveSOL; GetCursorPos; IF CP = Result THEN MoveUp;"
  45.   META-NUM_PAD-0         ExecARexxString "InsertLine; DeleteSOL; MoveLeft"
  46.   MODE-META-NUM_PAD-0    ExecARexxString "InsertLine; DeleteSOL; MoveLeft"
  47.  
  48.   NUM_PAD-.              ExecARexxString "options results; GetBlkInfo; parse var Result BlockOn .; IF BlockOn = OFF THEN MarkBlk; ELSE SetStatusBar Temporary 'Block already marked!'"
  49.   META-NUM_PAD-.         ExecARexxString "options results; GetBlkInfo; parse var Result BlockOn .; IF BlockOn = ON THEN  MarkBlk;"
  50.   MODE-META-NUM_PAD-.    ExecARexxString "options results; GetBlkInfo; parse var Result BlockOn .; IF BlockOn = ON THEN  MarkBlk;"
  51.  
  52.   META-NUM_PAD-Enter      ExecARexxString LockDisplay "options results;SetPrefs FindBackward OFF;GetPrefs FindString;l=Length(Result);Find;if RC=0 then do;Delete l;PasteClip;end;else SetStatusBar Temporary *"Not found!*""
  53.   MODE-META-NUM_PAD-Enter ExecARexxString "options results; SetPrefs FindBackward ON; GetPrefs FindString; FLength = Length(Result); Find; IF RC = 0 THEN DO; Delete FLength; PasteClip; END; ELSE SetStatusBar Temporary 'Not found!'"
  54.  
  55.   NUM_PAD-1              MoveNextWord
  56.   MODE-NUM_PAD-1         MovePrevWord
  57.   META-NUM_PAD-1         ToggleCharCase
  58.   MODE-META-NUM_PAD-1    ExecARexxString "ToggleCharCase; MoveLeft 2"
  59.  
  60.   NUM_PAD-2              ExecARexxString "options results; GetCursorPos; CP = Result; MoveEOL; GetCursorPos; IF Result = CP THEN DO; MoveDown; MoveEOL; END;"
  61.   MODE-NUM_PAD-2         ExecARexxString "MoveUp; MoveEOL"
  62.   META-NUM_PAD-2         ExecARexxString "options results; GetCursorPos; Parse var result Line Column .; Getline Column; IF Result = '' THEN Call SetClip('TTXVTDelLine'); ELSE Call SetClip('TTXVTDelLine', '22'x || Result || '22'x); DeleteEOL"
  63.   MODE-META-NUM_PAD-2    ExecARexxString "options results; GetCursorPos; Parse var result Line Column .; Getline Column; IF Result = '' THEN Call SetClip('TTXVTDelLine'); ELSE Call SetClip('TTXVTDelLine', '22'x || Result || '22'x); DeleteEOL"
  64.  
  65.   NUM_PAD-3              MoveRight
  66.   MODE-NUM_PAD-3         MoveLeft
  67.   META-NUM_PAD-3         ExecARexxString "options results; RequestNum 'Enter code:'; KeyCode = Result; options; Insert D2C(KeyCode)"
  68.   MODE-META-NUM_PAD-3    ExecARexxString "options results; RequestNum 'Enter code:'; KeyCode = Result; options; Insert D2C(KeyCode)"
  69.  
  70.   NUM_PAD-4              SetMode OFF
  71.   META-NUM_PAD-4         MoveEOF
  72.   MODE-META-NUM_PAD-4    MoveEOF
  73.  
  74.   NUM_PAD-5              SetMode ON
  75.   META-NUM_PAD-5         MoveSOF
  76.   MODE-META-NUM_PAD-5    MoveSOF
  77.  
  78.   NUM_PAD-6              ExecARexxString "options results; GetBlkInfo; parse var Result BlockOn .; IF BlockOn = ON THEN CutBlk; ELSE SetStatusBar Temporary 'No block marked!'"
  79.   META-NUM_PAD-6         PasteClip
  80.   MODE-META-NUM_PAD-6    PasteClip
  81.  
  82.   NUM_PAD-+              ExecARexxString "options results; GetChar; Result = Setclip('TTXVTDelChar', '22'x || Result || '22'x); Delete"
  83.   META-NUM_PAD-+         ExecARexxString "C = Getclip('TTXVTDelChar'); IF Center(C,1) = '0A'x THEN DO; InsertLine; DeleteSOL; MoveLeft; END; ELSE DO; Text C; MoveLeft; END"
  84.   MODE-META-NUM_PAD-+    ExecARexxString "C = Getclip('TTXVTDelChar'); IF Center(C,1) = '0A'x THEN DO; InsertLine; DeleteSOL; MoveLeft; END; ELSE DO; Text C; MoveLeft; END"
  85.  
  86.   NUM_PAD-7              MoveDownScr
  87.   MODE-NUM_PAD-7         MoveUpScr
  88.   META-NUM_PAD-7         ExecARexxMacro Console TurboText:Rexx/CmdShell.ttx
  89.   MODE-META-NUM_PAD-7    ExecARexxMacro Console TurboText:Rexx/CmdShell.ttx
  90.  
  91.   NUM_PAD-8              MoveDown 20
  92.   MODE-NUM_PAD-8         MoveUp 20
  93.   META-NUM_PAD-8         FormatParagraph
  94.   MODE-META-NUM_PAD-8    FormatParagraph
  95.  
  96.   NUM_PAD-9              ExecARexxMacro LockInput TurboText:Rexx/TTX_VT/KP_9.ttx
  97.   META-NUM_PAD-9         ExecARexxString "DeleteBlk; PasteClip"
  98.   MODE-META-NUM_PAD-9    ExecARexxString "DeleteBlk; PasteClip"
  99.  
  100.   NUM_PAD--              ExecARexxMacro TurboText:Rexx/TTX_VT/KP_Minus.ttx
  101.   META-NUM_PAD--         ExecARexxString "SetBookmark 0; IF Getclip('TTXVTDelWord') = '' THEN DO; InsertLine; DeleteSOL; MoveLeft; END; ELSE Text Getclip('TTXVTDelWord'); MoveBookmark 0"
  102.   MODE-META-NUM_PAD--    ExecARexxString "SetBookmark 0; IF Getclip('TTXVTDelWord') = '' THEN DO; InsertLine; DeleteSOL; MoveLeft; END; ELSE Text Getclip('TTXVTDelWord'); MoveBookmark 0"
  103.  
  104.   META-=                 ExecARexxString "SplitView Toggle; CenterView; SetBookmark 0; SwitchView; MoveBookMark 0; UpdateView; CenterView; SwitchView"
  105.   MODE-META-=            ExecARexxString "SplitView Toggle; CenterView; SetBookmark 0; SwitchView; MoveBookMark 0; UpdateView; CenterView; SwitchView"
  106.  
  107.   META-CURSOR_UP         SwitchView
  108.   MODE-META-CURSOR_UP    SwitchView
  109.  
  110.   META-CURSOR_DOWN       SwitchView
  111.   MODE-META-CURSOR_DOWN  SwitchView
  112.  
  113. #
  114.