=== modified file 'driver-csi.c' --- driver-csi.c 2012-04-24 16:27:48 +0000 +++ driver-csi.c 2012-04-24 15:33:13 +0000 @@ -187,21 +187,6 @@ return TERMKEY_RES_NONE; } -/* - * Handler for CSI R position reports - */ - -static TermKeyResult handle_csi_position(TermKey *tk, TermKeyKey *key, int cmd, long *arg, int args) -{ - if(args < 2) - return TERMKEY_RES_NONE; - - key->type = TERMKEY_TYPE_POSITION; - termkey_key_set_linecol(key, arg[0], arg[1]); - - return TERMKEY_RES_KEY; -} - static int register_keys(void) { int i; @@ -283,8 +268,6 @@ csi_handlers['M' - 0x40] = &handle_csi_mouse; csi_handlers['m' - 0x40] = &handle_csi_mouse; - csi_handlers['R' - 0x40] = &handle_csi_position; - keyinfo_initialised = 1; return 1; } === removed file 't/31position.c' --- t/31position.c 2012-04-24 16:27:48 +0000 +++ t/31position.c 1970-01-01 00:00:00 +0000 @@ -1,28 +0,0 @@ -#include "../termkey.h" -#include "taplib.h" - -int main(int argc, char *argv[]) -{ - TermKey *tk; - TermKeyKey key; - int line, col; - - plan_tests(5); - - tk = termkey_new_abstract("vt100", 0); - - termkey_push_bytes(tk, "\e[15;7R", 7); - - is_int(termkey_getkey(tk, &key), TERMKEY_RES_KEY, "getkey yields RES_KEY for position report"); - - is_int(key.type, TERMKEY_TYPE_POSITION, "key.type for position report"); - - is_int(termkey_interpret_position(tk, &key, &line, &col), TERMKEY_RES_KEY, "interpret_position yields RES_KEY"); - - is_int(line, 7, "line for position report"); - is_int(col, 15, "column for position report"); - - termkey_destroy(tk); - - return exit_status(); -} === modified file 'termkey.c' --- termkey.c 2012-04-24 16:27:48 +0000 +++ termkey.c 2012-04-24 14:25:17 +0000 @@ -956,16 +956,6 @@ return TERMKEY_RES_KEY; } -TermKeyResult termkey_interpret_position(TermKey *tk, const TermKeyKey *key, int *line, int *col) -{ - if(key->type != TERMKEY_TYPE_POSITION) - return TERMKEY_RES_NONE; - - termkey_key_get_linecol(key, line, col); - - return TERMKEY_RES_KEY; -} - TermKeyResult termkey_getkey(TermKey *tk, TermKeyKey *key) { size_t nbytes = 0; @@ -1307,9 +1297,6 @@ } } break; - case TERMKEY_TYPE_POSITION: - l = snprintf(buffer + pos, len - pos, "Position"); - break; } if(l <= 0) return pos; @@ -1407,32 +1394,18 @@ case TERMKEY_TYPE_UNICODE: if(key1.code.codepoint != key2.code.codepoint) return key1.code.codepoint - key2.code.codepoint; - break; case TERMKEY_TYPE_KEYSYM: if(key1.code.sym != key2.code.sym) return key1.code.sym - key2.code.sym; - break; case TERMKEY_TYPE_FUNCTION: if(key1.code.number != key2.code.number) return key1.code.number - key2.code.number; - break; case TERMKEY_TYPE_MOUSE: { int cmp = strncmp(key1.code.mouse, key2.code.mouse, 4); if(cmp != 0) return cmp; } - break; - case TERMKEY_TYPE_POSITION: - { - int line1, col1, line2, col2; - termkey_interpret_position(tk, &key1, &line1, &col1); - termkey_interpret_position(tk, &key2, &line2, &col2); - if(line1 != line2) - return line1 - line2; - return col1 - col2; - } - break; } return key1.modifiers - key2.modifiers; === modified file 'termkey.h.in' --- termkey.h.in 2012-04-24 16:27:48 +0000 +++ termkey.h.in 2012-03-26 17:30:04 +0000 @@ -95,8 +95,7 @@ TERMKEY_TYPE_UNICODE, TERMKEY_TYPE_FUNCTION, TERMKEY_TYPE_KEYSYM, - TERMKEY_TYPE_MOUSE, - TERMKEY_TYPE_POSITION + TERMKEY_TYPE_MOUSE } TermKeyType; typedef enum { @@ -200,8 +199,6 @@ TermKeyResult termkey_interpret_mouse(TermKey *tk, const TermKeyKey *key, TermKeyMouseEvent *event, int *button, int *line, int *col); -TermKeyResult termkey_interpret_position(TermKey *tk, const TermKeyKey *key, int *line, int *col); - typedef enum { TERMKEY_FORMAT_LONGMOD = 1 << 0, /* Shift-... instead of S-... */ TERMKEY_FORMAT_CARETCTRL = 1 << 1, /* ^X instead of C-X */