From 6dc2b9c72bf121aed0f9011d925b2c551a22ada2 Mon Sep 17 00:00:00 2001 From: Paul LeoNerd Evans Date: Thu, 26 Nov 2009 00:33:30 +0000 Subject: Implement mouse catching also in CSI driver, in case xterm-alike terminal without 'key_mouse' terminfo string --- driver-csi.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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; -- cgit v1.2.3-70-g09d2