----- Original Message -----
From: Mike Madore <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 14, 2000 2:05 AM
Subject: Re: The Diabolical Cursor Part II: This Time He's Mad

>
> The spec says that during the WRITE TO DISPLAY command the following logic
> is used to determine cursor position:
>
> if (keyboard is locked) then
>    Leave the cursor where it is
> else
>    1) Honer any insert cursor order
>    2) Move to the first non-bypass field
>    3) Move to position 0,0
>

That is how I do it (no warranty implied), if it's any help...

You DON'T move cursor while processing command.
You MUST do the processing on after WTD or Read,
in fact, I DEFER ALL IC and MC until then, and the action
DEPENDS on aCC = write control char 2:

  if ((aCC and $08) <> 0) and (State <> stateNormalUnlocked) then begin
    KeyboardLocked := False;
    AID.Reset;
    if SystemIC.IsMC then begin
      { MC order }
      if SystemIC.Pending then
        CurPos := SystemIC.Value;
    end else begin
      { IC order or nothing }
      if (aCC and $40) = 0 then
        MoveCursorHome;
    end;
  end;

where:

procedure TN5250Console.MoveCursorHome;
begin
  if SystemIC.Pending then
    CurPos := SystemIC.HomePos
  else begin
    CurPos := 0;
    Tab;
  end;
end;

I do SystemIC.Reset on

1) Clear Unit
2) Clear Format Table
3) At the begining of Start Of Header

If you see, I use MoveCursorHome on Home key too
(it took me a while to work that on out), whether it is
right or not, but I haven't seen any problems yet.

Sorry, the code is Delphi, but, I assume, it's simple enough.


Alex



+---
| This is the LINUX5250 Mailing List!
| To submit a new message, send your mail to [EMAIL PROTECTED]
| To subscribe to this list send email to [EMAIL PROTECTED]
| To unsubscribe from this list send email to [EMAIL PROTECTED]
| Questions should be directed to the list owner/operator: [EMAIL PROTECTED]
+---

Reply via email to