From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8712cb223249beaf X-Google-Attributes: gid103376,public From: "J. Marshall" Subject: Re: Mouse driver for Ada... how? Date: 1999/06/02 Message-ID: <928358735.459.102@news.remarQ.com>#1/1 X-Deja-AN: 485018755 References: <928346774.526.46@news.remarQ.com> <8bg53.656$HD.140382@typhoon-sf.snfc21.pbi.net> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 X-Complaints-To: newsabuse@remarQ.com X-Trace: 928358735.459.102 T3IZRAUEC0282CDF6C qube-02.us-ca.remarq.com Organization: Posted via RemarQ Communities, Inc. NNTP-Posting-Date: Wed, 02 Jun 1999 21:25:35 GMT Newsgroups: comp.lang.ada Date: 1999-06-02T00:00:00+00:00 List-Id: Thank you very much for the information. I appreciate your time and input. Jim Marshall tmoran@bix.com wrote in message <8bg53.656$HD.140382@typhoon-sf.snfc21.pbi.net>... >> So I had hoped to find some existing code examples. >Here's the spec of a (very old) mouse driver for DOS. It uses the >INT 33 services. In Windows you'd use the WM_MOUSEMOVE, >WM_LBUTTONDOWN, etc. events. If you don't have an OS service >available, don't have a vendor supplied driver, and are reduced to >handling a serial byte stream yourself, your first need is to find >what bytes your mouse (trackball) sends. It's probably not too >complex, and thus not too hard to write code to process it. > >with system; > >package mouse is -- low level mouse driver interface > -- uses int33 functions > -- 16#00#: reset > -- 16#0B#: read motion counters > -- 16#03#: get mouse position and button status > -- (ignore logical position from this) > -- In 1987 this interface was standard and supported > -- by all PC mice. > type state is > record > x,y:integer; > left_button,middle_button,right_button:boolean; > end record; > -- x,y measured in mickeys > -- button flags are true iff button is currently depressed > > current:state := > (x | y => 0,left_button | middle_button | right_button => FALSE); > > driver_missing:exception; -- will be raised at initialization > -- iff mouse driver is detected not present > -- ie if int33=0 or int33 points to an IRET > > procedure check; -- updates current (nop if mouse driver is missing) > > -- The public record 'current' is used, rather than having 'out' > -- parameters to the 'check' routine, for simplicity and efficiency. > -- There is no way with this interface to have more than one mouse > -- per OS task, so the generality of out parameters, or a generic > -- mouse package, would be spurious. > > procedure reset; > > procedure hide_cursor; > > procedure show_cursor; > > procedure horizontal_range(min,max:in natural); > > procedure vertical_range(min,max:in natural); > > type graphic_cursor_bits is array(integer range <>) of system.word; > subtype normal_graphic_cursor_bits is graphic_cursor_bits(0 .. 15); > subtype hot_spot_offsets is integer range -16 .. 16; > > procedure set_graphic_cursor_words(screen_mask:in graphic_cursor_bits; > cursor_mask:in graphic_cursor_bits; > x_hot_spot :in hot_spot_offsets; > y_hot_spot :in hot_spot_offsets); > > procedure Set_Cursor_Position(X,Y:in Integer); > >end mouse;