Logo Search packages:      
Sourcecode: iterm version File versions  Download package

int VTCore_send_mouse_position ( VTCore core,
int  button,
int  modifiers,
int  pressed,
int  col,
int  row 
)

Send mouse cursor position This should be called when

Parameters:
core reference to VTScreen object.
button button number 0 =<
modifiers modifiers of key(VTM_SHIFT, VTM_META or VTM_CONTROL)
pressed 1 if this button is pressed, 0 if released
col mouse column
row mouse row
Returns:
if send to the host return 1, else 0. Caller should NOT do anything after this returns 1;

Definition at line 527 of file core.c.

References VTCore_send_mouse_position(), and VTCore_write().

Referenced by VTCore_send_mouse_position().

{
  char string[8];
  strncpy(string,"\033[M",3);
  switch(core->screen->track_mouse.type)
  {
    case X10_MOUSE: /* X10 compatible  */
        if(modifiers == 0 && pressed != 0)
        {
          string[3] = ' ' + button;
          string[4] = ' ' + col + 1;
          string[5] = ' ' + row + 1;
          string[6] = '\0';
          VTCore_write(core,string,strlen(string));
          return 1;
        }
        break;
    case VT200_MOUSE: /* VT200 compatible */
        string[3] = ' ' + modifiers + (pressed ? button : 3);
        string[4] = ' ' + col + 1;
        string[5] = ' ' + row + 1;
        string[6] = '\0';
        VTCore_write(core,string,strlen(string));
        return 1;
    case 3:
    default:
        return 0;
  }
}


Generated by  Doxygen 1.6.0   Back to index