src/dosmouse.c
/***************************************************************/
/*              T h r e e B u t t o n H a n d l e r            */
/* This function is the interrupt handler for the mouse.       */
/* This function sets the state of the mouse structure and     */
/* signals the dispatch loop to take care of the matter. This  */
/* awkward solution is due to the severe braindamage in DOS.   */
/***************************************************************/
T h r e e B u t t o n H a n d l e r
This function is the interrupt handler for the mouse.
This function sets the state of the mouse structure and
signals the dispatch loop to take care of the matter. This
awkward solution is due to the severe braindamage in DOS.
T h r e e B u t t o n H a n d l e r This function is the interrupt handler for the mouse . This function sets the state of the mouse structure and signals the dispatch loop to take care of the matter . This awkward solution is due to the severe braindamage in DOS .
void ThreeButtonHandler()
{
  _XSTACK *stk_ptr;
  unsigned long mouse_flags;
  stk_ptr = (_XSTACK *)_get_stk_frame(); 
  stk_ptr->opts |= _STK_NOINT;           
  if (currentmouse->device.active) {
    mouse_flags = stk_ptr->eax; 
    if (mouse_flags & LB_PRESS) currentmouse->Button.Left = TRUE;
    if (mouse_flags & LB_OFF) currentmouse->Button.Left = FALSE;
    if (mouse_flags & CB_PRESS) currentmouse->Button.Middle = TRUE;
    if (mouse_flags & CB_OFF) currentmouse->Button.Middle = FALSE;
    if (mouse_flags & RB_PRESS) currentmouse->Button.Right = TRUE;
    if (mouse_flags & RB_OFF) currentmouse->Button.Right = FALSE;
    if ((!currentdsp->device.locked) && (mouse_flags & MOUSE_MV)) {
      currentmouse->Cursor.Moved = TRUE;
      Irq_Stk_Check = 0;
      Irq_Stk_End = 0;
    }
    if (mouse_flags & (LB_PRESS | LB_OFF | CB_PRESS | CB_OFF | RB_PRESS | RB_OFF))
      MouseButtonSignal(currentmouse);
  }
}
void ThreeButtonHandler ( ) { _XSTACK * stk_ptr ; unsigned long mouse_flags ; stk_ptr = ( _XSTACK * ) _get_stk_frame ( ) ; stk_ptr -> opts |= _STK_NOINT ; if ( currentmouse -> device . active ) { mouse_flags = stk_ptr -> eax ; if ( mouse_flags & LB_PRESS ) currentmouse -> Button . Left = TRUE ; if ( mouse_flags & LB_OFF ) currentmouse -> Button . Left = FALSE ; if ( mouse_flags & CB_PRESS ) currentmouse -> Button . Middle = TRUE ; if ( mouse_flags & CB_OFF ) currentmouse -> Button . Middle = FALSE ; if ( mouse_flags & RB_PRESS ) currentmouse -> Button . Right = TRUE ; if ( mouse_flags & RB_OFF ) currentmouse -> Button . Right = FALSE ; if ( ( ! currentdsp -> device . locked ) && ( mouse_flags & MOUSE_MV ) ) { currentmouse -> Cursor . Moved = TRUE ; Irq_Stk_Check = 0 ; Irq_Stk_End = 0 ; } if ( mouse_flags & ( LB_PRESS | LB_OFF | CB_PRESS | CB_OFF | RB_PRESS | RB_OFF ) ) MouseButtonSignal ( currentmouse ) ; } }
T h r e e B u t t o n H a n d l e r
This function is the interrupt handler for the mouse.
T h r e e B u t t o n H a n d l e r This function is the interrupt handler for the mouse .
/* First save the stack frame. */ /* Get ptr to V86 _XSTACK frame */ /* Bypass real-mode handler */ /* Save event flags from mouse driver */ /* Decode the transition bits. */