* Mouse driver for Ada... how? @ 1999-06-01 0:00 J. Marshall 1999-06-01 0:00 ` Steve Doiel 1999-06-02 0:00 ` Gautier 0 siblings, 2 replies; 8+ messages in thread From: J. Marshall @ 1999-06-01 0:00 UTC (permalink / raw) I am a complete novice with Ada, but have been assigned to update an existing application here. The task is to interface a trackball to a console running a Motorola 68030 VME bus computer. The trackball is a standard "PC type" serial device. Is there existing code available to show me the way? Any help would be greatly appreciated. Thanks very much. Jim Marshall ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Mouse driver for Ada... how? 1999-06-01 0:00 Mouse driver for Ada... how? J. Marshall @ 1999-06-01 0:00 ` Steve Doiel 1999-06-02 0:00 ` J. Marshall 1999-06-02 0:00 ` Gautier 1 sibling, 1 reply; 8+ messages in thread From: Steve Doiel @ 1999-06-01 0:00 UTC (permalink / raw) I have stumbled across documentation included with the Red Hat Linux distribution that describes the data streams that come from various serial mice. I would suggest starting there. You can probably find the same documentation on the web. I hope this helps, SteveD J. Marshall wrote in message <928269287.193.34@news.remarQ.com>... >I am a complete novice with Ada, but have been assigned to update an >existing application here. The task is to interface a trackball to a console >running a Motorola 68030 VME bus computer. The trackball is a standard "PC >type" serial device. Is there existing code available to show me the way? >Any help would be greatly appreciated. >Thanks very much. >Jim Marshall > > > ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Mouse driver for Ada... how? 1999-06-01 0:00 ` Steve Doiel @ 1999-06-02 0:00 ` J. Marshall 1999-06-02 0:00 ` tmoran 0 siblings, 1 reply; 8+ messages in thread From: J. Marshall @ 1999-06-02 0:00 UTC (permalink / raw) Thanks for that info. I was hoping to not have to re-invent the wheel, but it seems that existing Ada code is not quite as easy to find as I had been told. Management allocated 16 hours to add this piece of code into the project, including test and documentation. So I had hoped to find some existing code examples. I'm sure a seasoned Ada programmer could do this more easily. My experience is with C and some of the "visual" languages, mostly on Windows platforms. This VME machine is all new to me. Jim Marshall Steve Doiel wrote in message <37548b91.0@news.pacifier.com>... >I have stumbled across documentation included with the Red Hat Linux >distribution >that describes the data streams that come from various serial mice. I would >suggest starting there. You can probably find the same documentation on the >web. > >I hope this helps, > >SteveD > >J. Marshall wrote in message <928269287.193.34@news.remarQ.com>... >>I am a complete novice with Ada, but have been assigned to update an >>existing application here. The task is to interface a trackball to a >console >>running a Motorola 68030 VME bus computer. The trackball is a standard "PC >>type" serial device. Is there existing code available to show me the way? >>Any help would be greatly appreciated. >>Thanks very much. >>Jim Marshall >> ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Mouse driver for Ada... how? 1999-06-02 0:00 ` J. Marshall @ 1999-06-02 0:00 ` tmoran 1999-06-02 0:00 ` J. Marshall 1999-06-02 0:00 ` Gautier 0 siblings, 2 replies; 8+ messages in thread From: tmoran @ 1999-06-02 0:00 UTC (permalink / raw) > 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; ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Mouse driver for Ada... how? 1999-06-02 0:00 ` tmoran @ 1999-06-02 0:00 ` J. Marshall 1999-06-02 0:00 ` Gautier 1 sibling, 0 replies; 8+ messages in thread From: J. Marshall @ 1999-06-02 0:00 UTC (permalink / raw) 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; ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Mouse driver for Ada... how? 1999-06-02 0:00 ` tmoran 1999-06-02 0:00 ` J. Marshall @ 1999-06-02 0:00 ` Gautier 1 sibling, 0 replies; 8+ messages in thread From: Gautier @ 1999-06-02 0:00 UTC (permalink / raw) tmoran@bix.com wrote: > Here's the spec of a (very old) mouse driver for DOS. It uses the > INT 33 services. NB: there is one for GNAT/DOS 3.05-3.11 in PC_PAQS.ZIP @ http://members.xoom.com/gdemont/gsoft.htm But as you (and I) suspect, Mr Marshall is looking rather for some int33 _server_ source that one can find in... http://ftpsearch.lycos.com/cgi-bin/search?form=normal&query=ctmous16 -- Gautier -------- http://members.xoom.com/gdemont/ ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Mouse driver for Ada... how? 1999-06-01 0:00 Mouse driver for Ada... how? J. Marshall 1999-06-01 0:00 ` Steve Doiel @ 1999-06-02 0:00 ` Gautier 1999-06-02 0:00 ` J. Marshall 1 sibling, 1 reply; 8+ messages in thread From: Gautier @ 1999-06-02 0:00 UTC (permalink / raw) To: J. Marshall > I am a complete novice with Ada, but have been assigned to update an > existing application here. The task is to interface a trackball to a console > running a Motorola 68030 VME bus computer. The trackball is a standard "PC > type" serial device. Is there existing code available to show me the way? > Any help would be greatly appreciated. * Maybe the manufacturer of the trackball has a driver skeleton (in any language). * There is an excellent PC mouse driver on the Net, Cute Mouse, with ASM sources: http://ftpsearch.lycos.com/cgi-bin/search?form=normal&query=ctmous16 -- Gautier -------- http://members.xoom.com/gdemont/ ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Mouse driver for Ada... how? 1999-06-02 0:00 ` Gautier @ 1999-06-02 0:00 ` J. Marshall 0 siblings, 0 replies; 8+ messages in thread From: J. Marshall @ 1999-06-02 0:00 UTC (permalink / raw) Thanks very much for the information. The "Cute Mouse" source is quite useful, giving me a basic structure to guide me. Combined with the other information I've received here, I may have this done by tomorrow. I greatly appreciate the time and input from everyone here. Thanks! Jim Marshall Gautier wrote in message <3755786A.11681306@Maths.UniNe.CH>... >> I am a complete novice with Ada, but have been assigned to update an >> existing application here. The task is to interface a trackball to a console >> running a Motorola 68030 VME bus computer. The trackball is a standard "PC >> type" serial device. Is there existing code available to show me the way? >> Any help would be greatly appreciated. > >* Maybe the manufacturer of the trackball has a driver skeleton (in any language). >* There is an excellent PC mouse driver on the Net, Cute Mouse, with ASM sources: > >http://ftpsearch.lycos.com/cgi-bin/search?form=normal&query=ctmous16 > >-- >Gautier > >-------- >http://members.xoom.com/gdemont/ ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~1999-06-02 0:00 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 1999-06-01 0:00 Mouse driver for Ada... how? J. Marshall 1999-06-01 0:00 ` Steve Doiel 1999-06-02 0:00 ` J. Marshall 1999-06-02 0:00 ` tmoran 1999-06-02 0:00 ` J. Marshall 1999-06-02 0:00 ` Gautier 1999-06-02 0:00 ` Gautier 1999-06-02 0:00 ` J. Marshall
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox