Mouse Drivers in Pascal (possibly some assembler) ? 
Author Message
 Mouse Drivers in Pascal (possibly some assembler) ?

Has anyone written a mouse driver in Pascal ?( Turbo Pascal 7.0 or >).
If so, could I maybee peek at the source ?

Tim Henson,

Young software developer.



Wed, 18 Jun 1902 08:00:00 GMT  
 Mouse Drivers in Pascal (possibly some assembler) ?

Quote:

>Has anyone written a mouse driver in pascal ?( Turbo Pascal 7.0 or >).
>If so, could I maybee peek at the source ?

What's wrong with using the Microsoft Mouse Driver?  (Int 33h, look at
Ralph Brown's interrupt list)

-Chris
Remove "junkmail" in my return address to reply.



Wed, 18 Jun 1902 08:00:00 GMT  
 Mouse Drivers in Pascal (possibly some assembler) ?

Quote:

> Has anyone written a mouse driver in pascal ?( Turbo Pascal 7.0 or >).
> If so, could I maybee peek at the source ?

> Tim Henson,

> Young software developer.

Very easy : you have to use the BIOS interruption 33.


Wed, 18 Jun 1902 08:00:00 GMT  
 Mouse Drivers in Pascal (possibly some assembler) ?

Quote:


> > Has anyone written a mouse driver in pascal ?( Turbo Pascal 7.0 or >).
> > If so, could I maybee peek at the source ?

> > Tim Henson,

> > Young software developer.
> Very easy : you have to use the BIOS interruption 33.

Hello,

I am an little pascal-programmer. I can use filehandling procedures,
writeing text (that's easy), drawing lines, a little about installing
graph (I've got a book what tells how to do that, and I get it.), but; I
don't know anything about Interruption procedures. Like intr, isn't is?

Can anyone tell me how to use that?

I've written a program that can do the next;
-Save names of artists, their single, what the name is of the CD, and on
what track. In a file
-You can type an artist-name and the program will give all the singles
with, CD and track on the screen.
-You can delete all the artists in the list.

So now you know what I can do yet.

Regards Germ,



Wed, 18 Jun 1902 08:00:00 GMT  
 Mouse Drivers in Pascal (possibly some assembler) ?

for the one who reply's:

I'm not a parent, im 'just' a child who 14 years old is.



Wed, 18 Jun 1902 08:00:00 GMT  
 Mouse Drivers in Pascal (possibly some assembler) ?

(*****************************************************************************

*
*
* The Complete Int 33h Unit, JSoft
development                               *
* Copyright (c) 1997, All Rights
Reserved                                    *
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
******************************************************************************)

Unit CI33U;

Interface

Const
       Message : String = 'CI33U by James Holden (c)1997';

Type
       Mouse_Get_Record   = Record
                              XCoord,
                              YCoord  : Integer;
                              Button  : Byte;
                            End;

       Mouse_Limit_Record = Record
                              X1,Y1,
                              X2,Y2,
                              {*filter*}   : Byte;
                            End;

Implementation

(*****************************************************************************

*
*
* This will initialise the mouse and return both a true/fals install
result  *
* and thenumber of available mouse
buttons.                                  *
*
*
*****************************************************************************)

Function Mouse_Init( VAR NumButtons : Byte ) : Boolean;
Var
   InstallStatus  : Integer;           { Must be integer, byte cant go
neg. }
   TempNumButton  : Integer;

Begin
  Asm
     MOV AX, 0000H                                     { set ax to 0000
hex }
     INT 33H                                                  { call int
33 }
     MOV [InstallStatus], AX                  { whats in ax put to
installs }
     MOV [TempNumButton], BX                    { whats in bx put to
numbut }
  End;
  NumButtons := TempNumButton;
  if InstallStatus = -1 then Mouse_Init:=True    { if <> -1 then no
install }
    else Mouse_Init:=False;
End;

(*****************************************************************************

*
*
* This will display the mouse cursr to the
screen                            *
*
*
*****************************************************************************)

Procedure Mouse_Show; Assembler;
Asm
   MOV AX, 0001H
   INT 33H
End;

(*****************************************************************************

*
*
* This will hide the mouse cursor from the screen, it will still
function..  *
*
*
*****************************************************************************)

Procedure Mouse_Hide; Assembler;
Asm
   MOV AX, 0002H
   INT 33H
End;

(*****************************************************************************

*
*
* This will get the current x,y coords and return the button
currently       *
* pressed, there are various num button
answers                              *
*
*
*****************************************************************************)

Procedure Mouse_GetCoord( ReturnType      : Byte;
                          VAR GetCoordRec : Mouse_Get_Record );
Var
   TempXCoord,
   TempYCoord : Integer;
   TempButton : Integer;

Begin
  Asm
     MOV AX, 0003H
     INT 33H
     MOV [TempButton], BX
     MOV [TempXCoord], CX
     MOV [TempYCoord], DX
  End;
  With GetCoordRec do
  Begin
    if ReturnType=0 then
    Begin
      XCoord := TempXCoord;
      YCoord := TempYCoord;
      Button := TempButton;
    End
     Else
      Begin
        XCoord := (TempXCoord div 8)+1;
        YCoord := (TempYCoord div 8)+1;
        Button := TempButton;
      End;
End;

(*****************************************************************************

*
*
* This will check an area of x1,y1,x2,y2 and a button code and return
true   *
* if the current x,y satisfies this else its
false                           *
*
*
*****************************************************************************)

Function Mouse_CheckCoord( GetMouse   : Mouse_Get_Record;
                           LimitMouse : Mouse_Limit_Record ) : Boolean;
Begin
  { Can i note hewre that this can be extensivel modified, i have
included
    a more lengthy procedure in a seperate file called GETMOUSE.PAS
which
    basically concentrates on how to decide if the mouse is in an area
and
    wether it satisfies certain criteria etc, this is extremely simple!

Quote:
}

  With GetMouse do
    With LimitMouse do
     Begin
      if (XCoord >= X1) AND (XCoord <= X2) AND
         (YCoord >= Y1) AND (YCoord <= Y2) AND
         (Button = Butt) then Mouse_CheckCoord := True
         Else
          Mouse_CheckCoord := False;
     End;
End;

(*****************************************************************************

*
*
* This sets the posisition of the mouse cursor at X and Y, please note
that  *
* this works for DOS/GFX as do all
procedures                                *
*
*
*****************************************************************************)

Procedure Mouse_SetPosistion( X,Y : Integer ); Assembler;
Asm
   MOV AX, 0004H
   MOV CX, [X]
   MOV DX, [Y]
   INT 33H
End;

theres lots more

end.



Wed, 18 Jun 1902 08:00:00 GMT  
 Mouse Drivers in Pascal (possibly some assembler) ?

(*****************************************************************************

*
*
* The Complete Int 33h Unit, JSoft
development                               *
* Copyright (c) 1997, All Rights
Reserved                                    *
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
******************************************************************************)

Unit CI33U;

Interface

Const
       Message : String = 'CI33U by James Holden (c)1997';

Type
       Mouse_Get_Record   = Record
                              XCoord,
                              YCoord  : Integer;
                              Button  : Byte;
                            End;

       Mouse_Limit_Record = Record
                              X1,Y1,
                              X2,Y2,
                              {*filter*}   : Byte;
                            End;

Implementation

(*****************************************************************************

*
*
* This will initialise the mouse and return both a true/fals install
result  *
* and thenumber of available mouse
buttons.                                  *
*
*
*****************************************************************************)

Function Mouse_Init( VAR NumButtons : Byte ) : Boolean;
Var
   InstallStatus  : Integer;           { Must be integer, byte cant go
neg. }
   TempNumButton  : Integer;

Begin
  Asm
     MOV AX, 0000H                                     { set ax to 0000
hex }
     INT 33H                                                  { call int
33 }
     MOV [InstallStatus], AX                  { whats in ax put to
installs }
     MOV [TempNumButton], BX                    { whats in bx put to
numbut }
  End;
  NumButtons := TempNumButton;
  if InstallStatus = -1 then Mouse_Init:=True    { if <> -1 then no
install }
    else Mouse_Init:=False;
End;

(*****************************************************************************

*
*
* This will display the mouse cursr to the
screen                            *
*
*
*****************************************************************************)

Procedure Mouse_Show; Assembler;
Asm
   MOV AX, 0001H
   INT 33H
End;

(*****************************************************************************

*
*
* This will hide the mouse cursor from the screen, it will still
function..  *
*
*
*****************************************************************************)

Procedure Mouse_Hide; Assembler;
Asm
   MOV AX, 0002H
   INT 33H
End;

(*****************************************************************************

*
*
* This will get the current x,y coords and return the button
currently       *
* pressed, there are various num button
answers                              *
*
*
*****************************************************************************)

Procedure Mouse_GetCoord( ReturnType      : Byte;
                          VAR GetCoordRec : Mouse_Get_Record );
Var
   TempXCoord,
   TempYCoord : Integer;
   TempButton : Integer;

Begin
  Asm
     MOV AX, 0003H
     INT 33H
     MOV [TempButton], BX
     MOV [TempXCoord], CX
     MOV [TempYCoord], DX
  End;
  With GetCoordRec do
  Begin
    if ReturnType=0 then
    Begin
      XCoord := TempXCoord;
      YCoord := TempYCoord;
      Button := TempButton;
    End
     Else
      Begin
        XCoord := (TempXCoord div 8)+1;
        YCoord := (TempYCoord div 8)+1;
        Button := TempButton;
      End;
End;

(*****************************************************************************

*
*
* This will check an area of x1,y1,x2,y2 and a button code and return
true   *
* if the current x,y satisfies this else its
false                           *
*
*
*****************************************************************************)

Function Mouse_CheckCoord( GetMouse   : Mouse_Get_Record;
                           LimitMouse : Mouse_Limit_Record ) : Boolean;
Begin
  { Can i note hewre that this can be extensivel modified, i have
included
    a more lengthy procedure in a seperate file called GETMOUSE.PAS
which
    basically concentrates on how to decide if the mouse is in an area
and
    wether it satisfies certain criteria etc, this is extremely simple!

Quote:
}

  With GetMouse do
    With LimitMouse do
     Begin
      if (XCoord >= X1) AND (XCoord <= X2) AND
         (YCoord >= Y1) AND (YCoord <= Y2) AND
         (Button = Butt) then Mouse_CheckCoord := True
         Else
          Mouse_CheckCoord := False;
     End;
End;

(*****************************************************************************

*
*
* This sets the posisition of the mouse cursor at X and Y, please note
that  *
* this works for DOS/GFX as do all
procedures                                *
*
*
*****************************************************************************)

Procedure Mouse_SetPosistion( X,Y : Integer ); Assembler;
Asm
   MOV AX, 0004H
   MOV CX, [X]
   MOV DX, [Y]
   INT 33H
End;

theres lots more

end.



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. assembler mouse unit(easy to use)

2. Delphi -> Excel: Possibly a first step

3. BGI driver & mouse

4. USB (mouse) drivers

5. mouse driver for dos?!?

6. Micro$oft Mouse Driver

7. Mouse driver vor high resolution

8. Mouse driver for high resolution

9. DOS Mouse Driver for VESA16.BGI

10. driver for PS/2 mouse

11. Need help/mouse driver

12. Need help 2/mouse driver

 

 
Powered by phpBB® Forum Software