Mouse

yo iam back,
do you have to program the mouse into your program and if so how do you do this?

Sweeney

Comments

  • [b][red]This message was edited by slicer69 at 2003-7-10 11:2:30[/red][/b][hr]
    Pascal requires that you use a library of mouse functions. Or use in-line assembly. To get around this, you can use my Pascal Mouse library.
    http://slicer69.tripod.com/code/

    I believe the library is called "working with the mouse" and it's near the bottom of the page. If you have an questions about its use, drop me a line.
    Jesse

    : yo iam back,
    : do you have to program the mouse into your program and if so how do you do this?
    :
    : Sweeney
    :



  • : [b][red]This message was edited by slicer69 at 2003-7-10 11:2:30[/red][/b][hr]
    : Pascal requires that you use a library of mouse functions. Or use in-line assembly. To get around this, you can use my Pascal Mouse library.
    : http://slicer69.tripod.com/code/
    :
    : I believe the library is called "working with the mouse" and it's near the bottom of the page. If you have an questions about its use, drop me a line.
    : Jesse
    :
    : : yo iam back,
    : : do you have to program the mouse into your program and if so how do you do this?
    : :
    : : Sweeney
    : :
    :
    :
    :

    how do I use it? I copyed and pasted it into notpad saved it into my pascal folder. I tryed uses mouse; but it dosent reconise it says dose not reconise mouse.TPU I tryed changeing it to TPU still neve worked!

    Sweeney
  • : yo iam back,
    : do you have to program the mouse into your program and if so how do you do this?
    :
    : Sweeney
    :

    I have done it many times using Assembly (Int 33h) and made a unit ans it has worked awesome, except... Windows XP doesn't support int 33h properly. I found that it will still recognize the mouse buttons, but not the mouse position. Here is an assembly procedure for mouse position and buttons.

    [code]
    PROCEDURE GetMouse(VAR X, Y : Word; VAR Buttons : Byte);
    VAR
    TempX, TempY, TempB : Word;
    Begin
    ASM
    Mov Ax, $0003
    Int $33
    Mov TempB, Bx
    Mov TempX, Cx
    Mov TempY, Dx
    End;
    Buttons := TempB; { 0=None, 1=Left, 2=Right, 4=Middle }
    X := TempX;
    Y := TempY;
    End;
    [/code]

    There is a way of doing it without using the temp Variables, but I can't remember and don't feel like searching when this will work just fine. Also, if you set Ax->$0001 and call Int $33, it will show the mouse cursor (320x200x256 mode only) and if you set Ax->$0002 and call Int $33, it will hide the mouse cursor.
    You can play around with other sub-functions as well:
    $0001=Show Cursor
    $0002=Hide Cursor
    $0003=Get Position and Buttons
    $0004=Set Position (Cx = MouseX and Dx = MouseY)
    $0005=Used for Double-Click
    $0007=Set Min/Max Horizontal Movement
    $0008=Set Min/Max Vertical Movement

    Anyways, this should get you started. If you want them all, Download HelpPC by David Jurgens. Should be able to find it on a search engine.

    Phat Nat

  • : I have done it many times using Assembly (Int 33h) and made a unit ans it has worked awesome, except... Windows XP doesn't support int 33h properly. I found that it will still recognize the mouse buttons, but not the mouse position. Here is an assembly procedure for mouse position and buttons......................................
    :
    : Phat Nat
    :
    :
    Hi Phat,
    Do you know if there is a way to get this working in Windows XP. I've written my own mouse unit years ago and it works fine in DOS, WIn9x and WinNT, but as you also mentioned not in Windows XP. Is there a solution for this. I'm using Boreland Pascal 7.0

    Thanks,
    Frans
  • : : I have done it many times using Assembly (Int 33h) and made a unit ans it has worked awesome, except... Windows XP doesn't support int 33h properly. I found that it will still recognize the mouse buttons, but not the mouse position. Here is an assembly procedure for mouse position and buttons......................................
    : :
    : : Phat Nat
    : :
    : :
    : Hi Phat,
    : Do you know if there is a way to get this working in Windows XP. I've written my own mouse unit years ago and it works fine in DOS, WIn9x and WinNT, but as you also mentioned not in Windows XP. Is there a solution for this. I'm using Boreland Pascal 7.0
    :
    : Thanks,
    : Frans

    Unfortunately not that I found, however I haven't played with it much in the past while. You may need to write your own driver to get data directly from the hardware instead of going through the BIOS. I don't know though.

    Sorry,
    Phat Nat
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories