• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 214
  • Last Modified:

Mouse driver

I need to write a mouse driver for hi resolution in real mode .It's meens no Interapts .
Thanks and answer in C,C++,Pascal,Asmbler will do
By.
0
samcurr
Asked:
samcurr
1 Solution
 
snoeglerCommented:
"It's meens no Interapts" ...  what does that mean? No BIOS mouse interrupts?
If not, you'd need to read directly from RS-232. I can explain, if you want this.
Otherwise, if you'd like a list of int 33 handlers which do the hi res mouse position reading
for you, i have a book which lists them. I could post you the ones you need, if you tell
which operations you need.
0
 
thresher_sharkCommented:
Just out of curiousity, why can't you use interupts (providing that is what you mean by "Interapts")?
0
 
samcurrAuthor Commented:
I already tried  interrupts they doesn't work with the graphic library I use .
RS-232 that’s the thing I need (I think).

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
snoeglerCommented:
I have done this some time ago, and i can't find the sources for my code again :(
But i remember how it was done:
All microsoft compatible mouses use the communication params 9600,n,8,1. You can ignore
the handshaking signals, i think. The you will always receive 3 byte pairs of information.
The first one contains information about the status of the mouse buttons, the second
(third) contains the delta value in x(y) direction.
Of course, all features like mouse acceleration and bounds checking you'd need to code
yourself. Also if you don't want to poll the mouse events, you'd need to write a IRQ 4 handler
for COM1(or IRQ3 for COM2).
I will search again for my old source code, maybe i'll find it.

Can you explain why the interrupts don't work? They would save you a good piece of time :)
0
 
samcurrAuthor Commented:
interrupts do work but only in part the mouse pointer is not displayed on the screen I don’t won’t to write a program which will constantly check thought the interrupts for mouse position.


0
 
samcurrAuthor Commented:
interrupts do work but only in part the mouse pointer is not displayed on the screen I don’t won’t to write a program which will constantly check thought the interrupts for mouse position.
I will really if you find a source code I not very good in hardware.

0
 
snoeglerCommented:
You don't need to check the mouse position constantly using the mouse interrupts.
The mouse interrupt handlers support a user defined callback function which is called
everytime the mouse moves. But it is very much to post here ...
I would suggest that you buy yourself a book about system interrupts (perhaps an older
book) - shouldn't cost much money.
If you like me to explain, i will try, but i think you'll be better off having a book.
In short, you need to define an own interrupt handler which is called by the mouse support.
I would say that it's less effort to implement this instead of writing a mouse driver by yourself
But if you like, i'll post you the details - either on mouse interrupts or on mouse serial input.
0
 
samcurrAuthor Commented:
Thanks I will try to find a book but first if don't mind send to me anything you can on the
subject THe E.M.: b_samon@hotmail.com
Thanks , and if I still don't get it I will by a book .(by the way which book will you Suggest on programing hardware in general)
0
 
cphCommented:
Have a look at ctmousexx.zip where xx is the version (I think 1.5 is the latest)
It is part of the FreeDos Project on the web. the site is www.FreeDos.org
0
 
samcurrAuthor Commented:
to cph there exactly i looked for two hours sweept the
feedos up down & still didn't found it !!!!
0
 
sergelebelCommented:
in case your still looking!  I have some good assembler code for mouse support fot text base & graphics mode...I would suspect you want interrupt driven mouse control since attempting to control it trough the port is a huge task..especially if your not to good in hardware... you can reach me at  <Assemblr@hotmail.com>
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now