version 1.53, 2016/01/19 15:59:12 |
version 1.54, 2016/03/01 12:02:08 |
|
|
{ KEYC_KP_PERIOD, ".", 0 }, |
{ KEYC_KP_PERIOD, ".", 0 }, |
}; |
}; |
|
|
|
/* Split a character into two UTF-8 bytes. */ |
|
static size_t |
|
input_split2(u_int c, u_char *dst) |
|
{ |
|
if (c > 0x7f) { |
|
dst[0] = (c >> 6) | 0xc0; |
|
dst[1] = (c & 0x3f) | 0x80; |
|
return (2); |
|
} |
|
dst[0] = c; |
|
return (1); |
|
} |
|
|
/* Translate a key code into an output key sequence. */ |
/* Translate a key code into an output key sequence. */ |
void |
void |
input_key(struct window_pane *wp, key_code key, struct mouse_event *m) |
input_key(struct window_pane *wp, key_code key, struct mouse_event *m) |
|
|
m->sgr_b, x + 1, y + 1, m->sgr_type); |
m->sgr_b, x + 1, y + 1, m->sgr_type); |
} else if (wp->screen->mode & MODE_MOUSE_UTF8) { |
} else if (wp->screen->mode & MODE_MOUSE_UTF8) { |
len = xsnprintf(buf, sizeof buf, "\033[M"); |
len = xsnprintf(buf, sizeof buf, "\033[M"); |
len += utf8_split2(m->b + 32, &buf[len]); |
len += input_split2(m->b + 32, &buf[len]); |
len += utf8_split2(x + 33, &buf[len]); |
len += input_split2(x + 33, &buf[len]); |
len += utf8_split2(y + 33, &buf[len]); |
len += input_split2(y + 33, &buf[len]); |
} else { |
} else { |
if (m->b > 223) |
if (m->b > 223) |
return; |
return; |