Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site amiga.amiga.UUCP Path: utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!decwrl!pyramid!amiga!kodiak From: kodiak@amiga.UUCP (Robert [Kodiak] R. Burns) Newsgroups: net.micro.amiga Subject: SetMouse2 (use port 2 for your mouse) Message-ID: <967@amiga.amiga.UUCP> Date: Tue, 8-Apr-86 17:36:58 EST Article-I.D.: amiga.967 Posted: Tue Apr 8 17:36:58 1986 Date-Received: Thu, 10-Apr-86 20:54:42 EST Reply-To: kodiak@peabody.UUCP (Robert [Kodiak] R. Burns) Organization: Commodore-Amiga Inc., 983 University Ave #D, Los Gatos CA 95030 Lines: 66 /*********************************************************************/ /* */ /* ProgramName: SetMouse */ /* */ /* Purpose: To indicate that the mouse is connected to a */ /* specific game port */ /* */ /* Programmer: Kodiak, Commodore-Amiga Inc. */ /* */ /* PlagiarPolicy: You got it, use it however you want. */ /* */ /*********************************************************************/ #include "exec/types.h" #include "exec/nodes.h" #include "exec/lists.h" #include "exec/ports.h" #include "exec/io.h" #include "devices/input.h" struct IOStdReq ior; struct MsgPort iorp; main(argc, argv) int argc; char *argv[]; { UBYTE port; /**/ /* this is not intended to be a tutorial about how to get arguments /* from either the CLI or workbench, so I'll just hard code this to /* set the mouse port to port '2' (the right mouse port). Assign /* the value port = 0; to set port '1' (the left mouse port). /**/ port = 1; /* Open the input device */ if (OpenDevice("input.device", 0, &ior, 0) != 0) { exit(20); } /* set up the message port in the I/O request */ iorp.mp_Node.ln_Type = NT_MSGPORT; iorp.mp_Flags = 0; if ((iorp.mp_SigBit = AllocSignal(-1)) < 0) { CloseDevice(&ior); exit(20); } iorp.mp_SigTask = (struct Task *) FindTask((char *) NULL); NewList(&iorp.mp_MsgList); ior.io_Message.mn_ReplyPort = &iorp; /* initiate the I/O request to change the mouse port */ ior.io_Command = IND_SETMPORT; ior.io_Data = &port; ior.io_Length = 1; DoIO(&ior); /* clean up */ CloseDevice(&ior); FreeSignal(iorp.mp_SigBit); }