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

int VTCore_send_key ( VTCore core,
int  type 
)

method to send specified key

Parameters:
core reference to VTCore object
type key type

Definition at line 256 of file core.c.

References VTCore_send_key(), VTCore_write(), VTK_CR, VTK_F1, VTK_KP_0, and VTK_LEFT.

Referenced by VTCore_send_key().

{
  char string[16]; /* enough? */

  if(type == VTK_CR)
  {
    if(core->screen->linefeed)
        strcpy(string,"\r\n");
    else
        strcpy(string,"\r");
  }
  else  if(IsCursorKey(type))

  {
    if(core->screen->decmodes.decckm)
        strcpy(string,SS3);
    else
        strcpy(string,CSI);
    strcat(string,core->cursor[type-VTK_LEFT]);
  }
  else if(IsFunctionKey(type))
  {
    strcpy(string,CSI);
    strcat(string,function[type-VTK_F1]);
    strcat(string,"~");
  }
  else if(IsKeypadKey(type))
  {
    if(core->screen->deckpam)
    {
      strcpy(string,SS3);
      strcat(string,keypadapl[type-VTK_KP_0]);
    }
    else
        strcpy(string,keypadnum[type-VTK_KP_0]);
  }
  else 
      string[0] = 0; /* do nothing */
  return VTCore_write(core,string,strlen(string));
}


Generated by  Doxygen 1.6.0   Back to index