Howdy, Stranger!

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

Categories

Mouse Routines

Could someone please clear up things on a) how mouse routines work,

and b) how to make certain things happen from a left click etc. I've downloaded

millions of mouse scripts and stuff, but just dont understand them.


Preferably answer in an e-mail, but otherwise on here please.




Andrew.


Comments

  • : Could someone please clear up things on a) how mouse routines work,

    : and b) how to make certain things happen from a left click etc. I've downloaded

    : millions of mouse scripts and stuff, but just dont understand them.


    : Preferably answer in an e-mail, but otherwise on here please.


    :

    : Andrew.


    Most mouse programs use assembly. If your new to QB, unless you have a lot of experience in other programming languages, I wouldn't even try to understand it, just use it as is.


    As for mouse button effects, most programs have a variable initialized that holds a number, usually 1 or 0, to indicate if the button has been pressed.


    example:


    if lbutton = 1 then 'left button was pressed

    'Include whatever you would like to occure here

    end if


    Simple. Ofcourse the variable probably wont be called lbutton, but it might. You'll just have to look at the code and find out. You'll have to check and find out exactly what number the variable holds when the button is pressed as well. Not as difficult as it looks.


    The Gargoyle

    Just trying to help where I can


  • I made this library:


    '$INCLUDE: 'Qb.bi'

    DIM SHARED r AS RegTypex


    SUB ButStatus (But, NumPres, Lastx, Lasty)


    r.ax = 5

    r.bx = But

    Interruptx &H33, r, r

    But = r.ax

    NumPres = r.bx

    Lastx = r.cx

    Lasty = r.dx


    END SUB


    SUB DisableMouse (Succes)


    r.ax = &H1F

    Interruptx &H33, r, r

    Succes = r.ax


    END SUB


    SUB DisableRange (x, y, x1, y1)


    r.ax = 16

    r.cx = x

    r.dx = y

    r.si = x1

    r.di = y1

    Interruptx &H33, r, r


    END SUB


    SUB EnableMouse (Sucess)


    r.ax = &H20

    Interruptx &H33, r, r

    Succes = r.ax


    END SUB


    SUB GetBuffer (Buf)


    r.ax = 21

    Interruptx &H33, r, r

    Buf = r.bx


    END SUB


    SUB GetSensitiv (SpeedX, SpeedY, Sense)


    r.ax = 27

    Interruptx &H33, r, r

    SpeedX = r.bx

    SpeedY = r.cx

    Sense = r.dx


    END SUB


    SUB GetSpot (x, y, MouseType)


    r.ax = 42

    Interruptx &H33, r, r

    x = r.bx

    y = r.cx

    MouseType = r.dx


    END SUB


    SUB GetVer (Version, Tipe, Inter)


    r.ax = 36

    Interruptx &H33, r, r

    Version = INT(bx / 256) + ((bx - INT(bx / 256) * 256) / 100)

    Tipe = INT(cx / 256)

    Inter = bx - INT(bx / 256) * 256


    END SUB


    SUB GraphicMouse (Graphic(), x, y, Segment, Offset)


    DEF SEG = Segment

    FOR a = Offset TO Offset + 64

    POKE a, Graphic((a + 1) - Offset)

    NEXT a




    r.ax = 9

    r.bx = x

    r.cx = y

    r.es = Segment

    r.dx = Offset

    Interruptx &H33, r, r


    END SUB


    SUB HideMouse


    r.ax = 2

    Interruptx &H33, r, r


    END SUB


    SUB Limith (x, x1)


    r.ax = 7

    r.cx = x

    r.dx = x1

    Interruptx &H33, r, r


    END SUB


    SUB Limitv (x, x1)


    r.ax = 8

    r.cx = x

    r.dx = x1

    Interruptx &H33, r, r


    END SUB


    SUB LocateMouse (x, y)


    r.ax = 4

    r.cx = x

    r.dx = y

    Interruptx &H33, r, r


    END SUB


    SUB MouseMotion (MotionH, MotionV)


    r.ax = 11

    Interruptx &H33, r, r

    MotionH = r.cx

    MotionV = r.dx


    END SUB


    SUB MouseSens (Sense)


    r.ax = 19

    r.dx = Sense

    Interruptx &H33, r, r


    END SUB


    SUB MouseSensitiv (SpeedX, SpeedY, Sense)


    r.ax = 27

    r.bx = SpeedX

    r.cx = SpeedY

    r.dx = Sense

    Interruptx &H33, r, r




    END SUB


    SUB MouseStatus (But, x, y)


    r.ax = 3

    Interruptx &H33, r, r

    x = r.cx

    y = r.dx

    But = r.bx


    END SUB


    SUB NumButs (NBut)


    r.ax = 16

    Interruptx &H33, r, r

    NumBut = r.bx


    END SUB


    SUB PixelRatio (x, y)


    r.ax = 15

    r.cx = x

    r.dx = y

    Interruptx &H33, r, r


    END SUB


    SUB ReleaseStatus (But, NumPres, Lastx, Lasty)


    r.ax = 6

    r.bx = But

    Interruptx &H33, r, r

    NumPres = r.bx

    Lastx = r.cx

    Lasty = r.dx


    END SUB


    SUB ResetMouse (Status, NumBts)


    r.ax = 0

    Interruptx &H33, r, r

    IF r.ax = 0 THEN Status = 0 ELSE Status = 1

    IF r.bx = 2 OR r.bx = &HFFFF THEN r.bx = 2

    IF r.bx = 3 THEN r.bx = 3


    END SUB


    SUB RestoreState (Segment, Offset)


    r.ax = 23

    r.es = Segment

    r.dx = Offset

    Interruptx &H33, r, r


    END SUB


    SUB SaveState (Segment, Offset)


    r.ax = 22

    r.es = Segment

    r.dx = Offset

    Interruptx &H33, r, r


    END SUB


    SUB ShowMouse


    r.ax = 1

    Interruptx &H33, r, r


    END SUB


    SUB TextMouse (ScrMask, CurMask)


    r.ax = 10

    r.bx = 0

    r.cx = ScrMask

    r.dx = CurMask

    Interruptx &H33, r, r


    END SUB




Sign In or Register to comment.