Download

TextFrameAddition.Mod

Keyboard cursor control

The current Project Oberon system does not provide cursor movement by using the arrow-keys on your keyboard. However, the Oberon Core/Workstation application does pass ascii control codes for the arrow-keys into the Input module in the Oberon system.

Fortunately you can change the Oberon system to suit your personal taste or add desired features by changing the relevant module(s) yourself.

To obtain cursor control, you could use a ready-made solution, suggested to us by Jörg Straube. Insert the red lines to TextFrames.Write in your TextFrames.Mod file as follows (be aware of the line-ends if copying from your web browser):

..
ELSIF ch = 18X THEN (*ctrl-x,  cut*)
  IF F.hasSel THEN
    NEW(TBuf); Texts.OpenBuf(TBuf); Texts.Delete(F.text, F.selbeg.pos, F.selend.pos, TBuf)
  END
ELSIF ch = 11X THEN (* left *)
  IF F.carloc.pos > 0 THEN RemoveCaret(F); SetCaret(F, F.carloc.pos - 1) END
ELSIF ch = 12X THEN (* right *)
  IF F.carloc.pos < F.text.len THEN RemoveCaret(F); SetCaret(F, F.carloc.pos + 1) END
ELSIF ch = 13X THEN (* up *)
  RemoveCaret(F); SetCaret(F, Pos(F, F.X + F.carloc.x, F.Y + F.carloc.y + F.lsp))
ELSIF ch = 14X THEN (* down *)
  RemoveCaret(F); SetCaret(F, Pos(F, F.X + F.carloc.x, F.Y + F.carloc.y - F.lsp))
ELSIF (20X <= ch) & (ch <= DEL) OR (ch = CR) OR (ch = TAB) THEN
..

For convenience you can download these lines as a proper Oberon Text file, in zipped form. Put this file "TexframeAddition.Mod" in your Oberon folder, and use it as a "clipping" source for adapting your TextFrames.Mod file with Oberon's own text editing.

When done, you need to recompile TextFrames.Mod and restart Oberon.