diff options
| author | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2012-11-30 15:36:06 +0000 | 
|---|---|---|
| committer | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2012-11-30 15:36:06 +0000 | 
| commit | efc5b7e088fc219993f22dc827022b143913c1f8 (patch) | |
| tree | a0e070f4a8d59872c12c7cea3217d7f3448f7c48 /driver-csi.c | |
| parent | 8152f9e0184de47bc87fcde593c3b34e04bea1fe (diff) | |
| download | termo-efc5b7e088fc219993f22dc827022b143913c1f8.tar.gz termo-efc5b7e088fc219993f22dc827022b143913c1f8.tar.xz termo-efc5b7e088fc219993f22dc827022b143913c1f8.zip | |
Try to handle position reports -and- F3 concurrently.. somehow.. argh
Diffstat (limited to 'driver-csi.c')
| -rw-r--r-- | driver-csi.c | 18 | 
1 files changed, 13 insertions, 5 deletions
| diff --git a/driver-csi.c b/driver-csi.c index f4de6a8..ae0b50d 100644 --- a/driver-csi.c +++ b/driver-csi.c @@ -258,19 +258,27 @@ TermKeyResult termkey_interpret_mouse(TermKey *tk, const TermKeyKey *key, TermKe  /*   * Handler for CSI R position reports + * A plain CSI R with no arguments is probably actually <F3>   */  static TermKeyResult handle_csi_R(TermKey *tk, TermKeyKey *key, int cmd, long *arg, int args)  {    switch(cmd) {      case 'R': -      if(args < 2) -        return TERMKEY_RES_NONE; +      switch(args) { +        case 0: +          key->type = TERMKEY_TYPE_FUNCTION; +          key->code.number = 3; +          return TERMKEY_RES_KEY; -      key->type = TERMKEY_TYPE_POSITION; -      termkey_key_set_linecol(key, arg[1], arg[0]); +        case 2: +          key->type = TERMKEY_TYPE_POSITION; +          termkey_key_set_linecol(key, arg[1], arg[0]); +          return TERMKEY_RES_KEY; -      return TERMKEY_RES_KEY; +        default: +          return TERMKEY_RES_NONE; +      }      default:        return TERMKEY_RES_NONE;    } | 
