how can I know the mouse have been clicked?

Started by funfuny, June 28, 2008, 07:57:24 PM

Previous topic - Next topic

funfuny

how can I know the mouse is clicked?
1.do I have to use ifinite loop and check every milisecond how much time the mouse was clicked
with int 33h? or there is an interupt who waits untill the user clicks the mouse?

Im working with graphic mode (640X480)

sinsi

From RBIL
Quote
INT 33 - MS MOUSE v1.0+ - DEFINE INTERRUPT SUBROUTINE PARAMETERS
   AX = 000Ch
   CX = call mask (see #03171)
   ES:DX -> FAR routine (see #03172)
SeeAlso: AX=0018h

Bitfields for mouse call mask:
Bit(s)   Description   (Table 03171)
0   call if mouse moves
1   call if left button pressed
2   call if left button released
3   call if right button pressed
4   call if right button released
5   call if middle button pressed (Mouse Systems/Logitech/Genius mouse)
6   call if middle button released (Mouse Systems/Logitech/Genius mouse)
7-15   unused
Note:   some versions of the Microsoft documentation incorrectly state that CX
     bit 0 means call if mouse cursor moves

(Table 03172)
Values interrupt routine is called with:
   AX = condition mask (same bit assignments as call mask)
   BX = button state
   CX = cursor column
   DX = cursor row
   SI = horizontal mickey count
   DI = vertical mickey count
Notes:   some versions of the Microsoft documentation erroneously swap the
     meanings of SI and DI
   in text modes, the row and column will be reported as a multiple of
     the character cell size, typically 8x8 pixels
Light travels faster than sound, that's why some people seem bright until you hear them.

funfuny

can you please give me an example to function definition that uses this interrupt?

MichaelW

The attachment is a QuickBASIC mouse library coded in MASM 6+. It's probably not what you were expecting, but it does contain an example of using mouse driver function 12, Set Interrupt Subroutine Call Mask and Address.

In case it's not obvious, unless you are using this with QuickBASIC, you need to ignore all of the QB-related stuff, including B_OnExit.

[attachment deleted by admin]
eschew obfuscation

funfuny

thank you but i dont understand anything of what you say. can you please give me an example for how to use int 33h ax=000ch in a code