Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!columbia!caip!cbmvax!phillip From: phillip@cbmvax.cbm.UUCP (Phillip Lindsay) Newsgroups: net.micro.amiga Subject: Re: Some questions and a Digi-Review Message-ID: <677@cbmvax.cbmvax.cbm.UUCP> Date: Fri, 29-Aug-86 14:11:09 EDT Article-I.D.: cbmvax.677 Posted: Fri Aug 29 14:11:09 1986 Date-Received: Sat, 30-Aug-86 03:28:24 EDT References: <1679@well.UUCP> Organization: Commodore Technology, West Chester, PA Lines: 128 [ lines die and goto hell ] > Questions: > Does anyone have any good ideas of how to get RAW: keyboard data from > THE cli window without having to open a second window? Under 1.2 you'll be able to switch a regular CON: window into RAW: mode. A new packet is supported for this purpose (SetRawMode=994) ... I hacked Andy's earlier example of sending a ACTION_DISK_INFO packet to the console handler: (Here is the information from the release doc - program follows...) 2) A new packet action type SetRawMode (=994) is supported by the console device to switch it into raw mode and back again. The single argument is TRUE for raw mode (ie as if RAW: had been requested) and FALSE to turn it back to CON: style. Note that in addition to this an escape sequence may be sent by the user if required to turn on or off the automatic translation of LF to CR/LF. Normally RAW: does not enable this and CON: does, sending the packet SetRawMode does not affect the translation. The code is CSI 20h to enable translation and CSI 20l to disable. ......Cut Here /************************************************************************* * (C) 1986 Commodore-Amiga * Example program to demonstrate finding the CON: window pointer * by Andy Finkel and Robert (Kodiak) Burns * * HACKED quickly by Phillip Lindsay to show off CON: Raw mode... * * Use it any way you like, as long as the copyright notice is left on. * ************************************************************************/ #include "exec/types.h" #include "exec/ports.h" #include "exec/io.h" #include "exec/memory.h" #include "libraries/dos.h" #include "libraries/dosextens.h" #include "intuition/intuitionbase.h" #include #define ACTION_SCREEN_MODE 994L #define DOSTRUE -1L extern struct Library *OpenLibrary(); struct IntuitionBase *IntuitionBase = 0; struct MsgPort iorp = { {0, 0, NT_MSGPORT, 0, 0}, 0, -1, /* initialize signal to -1 */ 0, /* start with empty list */ {&iorp.mp_MsgList.lh_Tail, 0, &iorp.mp_MsgList.lh_Head, 0, 0} }; cleanup(code) { if (iorp.mp_SigBit != -1) FreeSignal(iorp.mp_SigBit); CloseLibrary(IntuitionBase); exit(20); } main(argc, argv) int argc; char *argv[]; { struct MsgPort *con; struct StandardPacket *packet; UBYTE a_char; if ((IntuitionBase = OpenLibrary("intuition.library", 0)) == 0) exit(20); /* set up the message port */ if ((iorp.mp_SigBit = AllocSignal(-1)) < 0) { cleanup(0); exit(35); } iorp.mp_SigTask = (struct Task *) FindTask((char *) NULL); /* try to find console associated with calling process */ /* if started from CLI, than is */ if ((iorp.mp_SigTask->tc_Node.ln_Type == NT_PROCESS)&&(argc != 0)) { con = (struct MsgPort *) ((struct Process *) iorp.mp_SigTask) -> pr_ConsoleTask; if (con != 0) { if ((packet = (struct StandardPacket *) AllocMem(sizeof(*packet), MEMF_CLEAR))) { /* this is the console handlers packet port */ packet->sp_Msg.mn_Node.ln_Name = &(packet->sp_Pkt); packet->sp_Pkt.dp_Link = &(packet->sp_Msg); packet->sp_Pkt.dp_Port = &iorp; packet->sp_Pkt.dp_Type = ACTION_SCREEN_MODE; packet->sp_Pkt.dp_Arg1 = DOSTRUE; PutMsg(con, packet); WaitPort(&iorp); GetMsg(&iorp); /* pull message */ puts("In RAW: mode...type something...press ESC to exit."); while((a_char=getchar())!=0x1b) putchar(a_char); packet->sp_Pkt.dp_Arg1 = FALSE; packet->sp_Pkt.dp_Port = &iorp; PutMsg(con, packet); WaitPort(&iorp); FreeMem(packet, sizeof(*packet)); } } } cleanup(0); } /* eof */ -- ============================================================================== Phillip Lindsay - Commodore Business Machines - Amiga Technical Support uucp: {ihnp4|seismo|caip}!cbmvax!phillip arpa: cbmvax!phillip@seismo -or- phillip@cbmvax.UUCP@{seismo | harvard} Tel.: (215) 431-9180 ==============================================================================