Skip to content

Commit

Permalink
move the cursor using the left and right arrow keys
Browse files Browse the repository at this point in the history
  • Loading branch information
ilovb committed Apr 2, 2014
1 parent b47da44 commit bf4c278
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Input.Mod
Expand Up @@ -63,16 +63,16 @@ MODULE Input; (*NW 5.10.86 / 15.11.90 Ceres-2; PDR 21.4.12 / NW 15.5.2013 Ceres-
00 6E 62 68 67 79 36 00 00 00 6D 6A 75 37 38 00
00 2C 6B 69 6F 30 39 00 00 2E 2F 6C 3B 70 2D 00
00 00 27 00 5B 3D 00 00 00 00 0D 5D 00 5C 00 00
00 00 00 00 00 00 08 00 00 00 00 00 00 00 00 00
00 7F 00 00 00 00 1B 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 08 00 00 00 00 11 00 00 00 00
00 7F 00 00 12 00 1B 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 09 7E 00
00 00 00 00 00 51 21 00 00 00 5A 53 41 57 40 00
00 43 58 44 45 24 23 00 00 20 56 46 54 52 25 00
00 4E 42 48 47 59 5E 00 00 00 4D 4A 55 26 2A 00
00 3C 4B 49 4F 29 28 00 00 3E 3F 4C 3A 50 5F 00
00 00 22 00 7B 2B 00 00 00 00 0D 7D 00 7C 00 00
00 00 00 00 00 00 08 00 00 00 00 00 00 00 00 00
00 7F 00 00 00 00 1B 00 00 00 00 00 00 00 00 00$)
00 00 00 00 00 00 08 00 00 00 00 11 00 00 00 00
00 7F 00 00 12 00 1B 00 00 00 00 00 00 00 00 00$)
END Init;

BEGIN Init
Expand Down
8 changes: 7 additions & 1 deletion TextFrames.Mod
Expand Up @@ -2,7 +2,7 @@ MODULE TextFrames; (*JG 8.10.90 / NW 10.5.2013*)
IMPORT Modules, Input, Display, Viewers, Fonts, Texts, Oberon, MenuViewers;

CONST replace* = 0; insert* = 1; delete* = 2; unmark* = 3; (*message id*)
BS = 8X; TAB = 9X; CR = 0DX; DEL = 7FX; FrameColor = 1;
BS = 8X; TAB = 9X; CR = 0DX; DEL = 7FX; FrameColor = 1; CRSL = 11X; CRSR = 12X;

TYPE Line = POINTER TO LineDesc;
LineDesc = RECORD
Expand Down Expand Up @@ -649,6 +649,12 @@ MODULE TextFrames; (*JG 8.10.90 / NW 10.5.2013*)
KW.fnt := fnt; KW.col := col; KW.voff := voff; Texts.Write(KW, ch);
Texts.Insert(F.text, F.carloc.pos, KW.buf);
SetCaret(F, F.carloc.pos + 1)
ELSIF (ch = CRSL) & (F.carloc.pos > 0) THEN
FlipCaret(F);
SetCaret(F, F.carloc.pos - 1)
ELSIF (ch = CRSR) & (F.carloc.pos < F.text.len) THEN
FlipCaret(F);
SetCaret(F, F.carloc.pos + 1)
END
END Write;

Expand Down

0 comments on commit bf4c278

Please sign in to comment.