diff options
author | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2009-11-26 00:33:30 +0000 |
---|---|---|
committer | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2009-11-26 00:33:30 +0000 |
commit | 6dc2b9c72bf121aed0f9011d925b2c551a22ada2 (patch) | |
tree | 66bb139f4d725436f64d431f9257ea31443696a4 | |
parent | c4bc0486d40477d8c9203b8696b77774aafed985 (diff) | |
download | termo-6dc2b9c72bf121aed0f9011d925b2c551a22ada2.tar.gz termo-6dc2b9c72bf121aed0f9011d925b2c551a22ada2.tar.xz termo-6dc2b9c72bf121aed0f9011d925b2c551a22ada2.zip |
Implement mouse catching also in CSI driver, in case xterm-alike terminal without 'key_mouse' terminfo string
-rw-r--r-- | driver-csi.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/driver-csi.c b/driver-csi.c index be05b6c..e1f63b2 100644 --- a/driver-csi.c +++ b/driver-csi.c @@ -235,6 +235,22 @@ static TermKeyResult peekkey_csi(TermKey *tk, TermKeyCsi *csi, size_t introlen, return TERMKEY_RES_NONE; } } + else if(cmd == 'M') { + size_t csi_len = csi_end + 1; + + tk->buffstart += csi_len; + tk->buffcount -= csi_len; + + TermKeyResult mouse_result = (*tk->method.peekkey_mouse)(tk, key, nbytep); + + tk->buffstart -= csi_len; + tk->buffcount += csi_len; + + if(mouse_result == TERMKEY_RES_KEY) + *nbytep += csi_len; + + return mouse_result; + } else { // We know from the logic above that cmd must be >= 0x40 and < 0x80 key->type = csi->csi_ss3s[cmd - 0x40].type; |