Howdy, Stranger!

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

Categories

how do i control the mouse in QBASIC 4.5

In QBASIC 1 , you could use CALL Absolute to interface with

the mouse, but not in 4.5? How do you do so in 4.5?


Thanks in Advanc


Comments

  • : In QBASIC 1 , you could use CALL Absolute to interface with

    : the mouse, but not in 4.5? How do you do so in 4.5?


    : Thanks in Advanc


    are you loading qb.qlb? (QB /L)




  • : : In QBASIC 1 , you could use CALL Absolute to interface with

    : : the mouse, but not in 4.5? How do you do so in 4.5?


    : : Thanks in Advanc


    : are you loading qb.qlb? (QB /L)

    you also need to have 'INCLUDE: 'QB.BI' at the top of your program







  • : In QBASIC 1 , you could use CALL Absolute to interface with

    : the mouse, but not in 4.5? How do you do so in 4.5?


    : Thanks in Advanc





  • 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




  • : In QBASIC 1 , you could use CALL Absolute to interface with

    : the mouse, but not in 4.5? How do you do so in 4.5?


    : Thanks in Advanc


    Very simple.


    Start QB /L (loads Library)


    CALL INTERRUPT (51, RegisterA, RegisterB, RegisterC, RegisterD)




    I have got a book at home about it..


    Please mail me and I'll mail you the

    chapter about Mousing in QB..

    Warning!

    Using a mouse

    in QB-programs

    under Windows NT

    "crashes"!


    This is because you're communicating directly

    to the BIOS, and Micro$oft does not allow you

    to do that (EVEN WHEN YOU ARE ADMINISTRATOR))


    FUCK M$ for doing this.. (I had to review

    all of my projects for this..)


    C-Ya

    EatMe

    HowLongDoesThisTake@HotMail.com





Sign In or Register to comment.