=== modified file 'termkey.c' --- termkey.c 2008-02-10 18:19:43 +0000 +++ termkey.c 2008-02-10 18:13:17 +0000 @@ -310,14 +310,8 @@ eatbytes(tk, csi_end + 1); - key->modifiers = 0; - key->flags = TERMKEY_KEYFLAG_SPECIAL; - if(cmd == '~') { - if(arg[0] == 27) { - do_codepoint(tk, arg[2], key); - } - else if(arg[0] >= 0 && arg[0] < tk->ncsifuncs) + if(arg[0] >= 0 && arg[0] < tk->ncsifuncs) key->code = tk->csifuncs[arg[0]]; else key->code = TERMKEY_SYM_UNKNOWN; @@ -333,8 +327,8 @@ fprintf(stderr, "CSI arg1=%d arg2=%d cmd=%c\n", arg[0], arg[1], cmd); } - if(args > 1 && arg[1] != -1) - key->modifiers |= arg[1] - 1; + key->modifiers = (args > 1 && arg[1] != -1) ? arg[1] - 1 : 0; + key->flags = TERMKEY_KEYFLAG_SPECIAL; return TERMKEY_RES_KEY; }