[comp.sys.amiga.tech] How to do low-level console I/O?

deven@rpi.edu (Deven T. Corzine) (04/13/90)

Another problem I had is regarding console input.  This isn't critical
for the async copier, but would be nice.  It would be more important
for some other programs I've wanted to write.  Basically, when the
program is run in a window, I want FULL control over that window.
Most importantly, I want to be able to do raw console I/O on a
character basis, not line oriented.  I would also like to be able to
play with the window menus, title bar, size, position, etc.

Now, I am aware you can send an ACTION_DISKINFO packet to the console
handler from a lock on "*" and get a pointer to the window in one of
the fields in the filled-in structure.  [by the way, can you just use
an Info() call on "*" instead of sending a packet manually?]  I saw
mention in some of Matt Dillon's code saying something about another
field containing the console device in the window...

What does this mean?  Is it a pointer to an IORequest?  Is it a copy
of the io_Device field from the IORequest?  Is it something else?  If
it is io_Device, is creating a new IORequest and initializing
io_Device from that field sufficient to send IORequests to the console
device open in that window?  Will it conflict with any pending
requests from CON:?  Does it matter that I'm using ConMan 1.3?

Would sending the escape sequence for RAW mode to * cause input to
revert to character at a time?  Would I be able to go into RAW mode
and keep it a simple character stream and not have to interpret
keycodes or filter out extraneous sequences and the like?  Still, I
would prefer to use Exec I/O to the console.device, I just don't want
to open a new window.

Is it legal to open a second console.device in the same window?  If I
do so, will it reliably get all input to that window, eating it before
the older console can see it?  Or will input go to either console
randomly?  And why do I keep asking so many questions?  :-)

Also, I seem to remember seeing somewhere that you could send some
specific packet (ACTION_INHIBIT?) to a CON: handler to let it switch
modes and act like a RAW: handler and back again.  This would be
acceptable, although a console device would be preferable.  Does
anyone know if this is possible, or how to do it?  I scoured the V1.1
AmigaDOS Manual, but was unable to find any information on this.  I am
left at a loss.

Basically, how do you DO this?  [It can be done; C-A's More V3.27
program does it...  perhaps it's disassembly time...]

Deven
-- 
Deven T. Corzine        Internet:  deven@rpi.edu, shadow@pawl.rpi.edu
Snail:  2151 12th St. Apt. 4, Troy, NY 12180   Phone:  (518) 274-0327
Bitnet:  deven@rpitsmts, userfxb6@rpitsmts     UUCP:  uunet!rpi!deven
Simple things should be simple and complex things should be possible.

martint@altitude.CAM.ORG (Martin Taillefer) (04/14/90)

In article <DEVEN.90Apr13073147@netserv2.rpi.edu> deven@rpi.edu (Deven T. Corzine) writes:
>Also, I seem to remember seeing somewhere that you could send some
>specific packet (ACTION_INHIBIT?) to a CON: handler to let it switch
>modes and act like a RAW: handler and back again.  This would be
>acceptable, although a console device would be preferable.  Does
>anyone know if this is possible, or how to do it?  I scoured the V1.1
>AmigaDOS Manual, but was unable to find any information on this.  I am
>left at a loss.

The packet is ACTION_SCREEN_MODE with the dp_Arg1 field set to DOSTRUE
to switch the console into RAW mode and DOSFALSE to set it back to
normal mode.
-- 
----------------------------------------
Martin Taillefer   INTERNET: martin@pnt.CAM.ORG
UUCP: uunet!philmtl!altitude!martint   TEL: 514/640-5734   BIX: vertex

deven@rpi.edu (Deven T. Corzine) (04/14/90)

In article <DEVEN.90Apr13073147@netserv2.rpi.edu> I write:

Deven> Also, I seem to remember seeing somewhere that you could send
Deven> some specific packet (ACTION_INHIBIT?) to a CON: handler to let
Deven> it switch modes and act like a RAW: handler and back again.
Deven> This would be acceptable, although a console device would be
Deven> preferable.  Does anyone know if this is possible, or how to do
Deven> it?  I scoured the V1.1 AmigaDOS Manual, but was unable to find
Deven> any information on this.  I am left at a loss.

On 13 Apr 90 22:57:49 GMT, martint@altitude.CAM.ORG (Martin Taillefer) said:

Martin> The packet is ACTION_SCREEN_MODE with the dp_Arg1 field set to
Martin> DOSTRUE to switch the console into RAW mode and DOSFALSE to
Martin> set it back to normal mode.

Oh, silly me.  I noticed it when I was glancing through the updated
V1.2 AmigaDOS manual at the store, which explains why I couldn't find
it in the V1.1 manual.  Thanks for the info.

Deven
-- 
Deven T. Corzine        Internet:  deven@rpi.edu, shadow@pawl.rpi.edu
Snail:  2151 12th St. Apt. 4, Troy, NY 12180   Phone:  (518) 274-0327
Bitnet:  deven@rpitsmts, userfxb6@rpitsmts     UUCP:  uunet!rpi!deven
Simple things should be simple and complex things should be possible.