diff options
author | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2012-04-12 00:19:10 +0100 |
---|---|---|
committer | Paul LeoNerd Evans <leonerd@leonerd.org.uk> | 2012-04-12 00:19:10 +0100 |
commit | 60b4bfaf72cab1af28c12031b2ffefc0ec7b1fb6 (patch) | |
tree | 17ad0a061b8c2e3a01040a806d010058f926157d /termkey.c | |
parent | ff99b29b967579d5ce82e752d0f8407233e67df2 (diff) | |
download | termo-60b4bfaf72cab1af28c12031b2ffefc0ec7b1fb6.tar.gz termo-60b4bfaf72cab1af28c12031b2ffefc0ec7b1fb6.tar.xz termo-60b4bfaf72cab1af28c12031b2ffefc0ec7b1fb6.zip |
Recognise SGR-style mouse encoding
Diffstat (limited to 'termkey.c')
-rw-r--r-- | termkey.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -894,6 +894,7 @@ static TermKeyResult peekkey_mouse(TermKey *tk, TermKeyKey *key, size_t *nbytep) key->code.mouse[0] = CHARAT(0) - 0x20; key->code.mouse[1] = CHARAT(1) - 0x20; key->code.mouse[2] = CHARAT(2) - 0x20; + key->code.mouse[3] = 0; key->modifiers = (key->code.mouse[0] & 0x1c) >> 2; key->code.mouse[0] &= ~0x1c; @@ -953,6 +954,9 @@ TermKeyResult termkey_interpret_mouse(TermKey *tk, const TermKeyKey *key, TermKe if(button) *button = btn; + if(key->code.mouse[3]) + *event = TERMKEY_MOUSE_RELEASE; + return TERMKEY_RES_KEY; } |