Support UTF-8 key bindings by expanding the key type from int to

uint64_t and converting UTF-8 to Unicode on input and the reverse on
output. (This allows key bindings, there are still omissions - the
largest being that the various prompts do not accept UTF-8.)
This commit is contained in:
nicm
2015-11-12 11:05:34 +00:00
parent 7062b0e65d
commit 69e0b8326a
19 changed files with 280 additions and 168 deletions

View File

@ -812,7 +812,7 @@ status_prompt_redraw(struct client *c)
/* Handle keys in prompt. */
void
status_prompt_key(struct client *c, int key)
status_prompt_key(struct client *c, key_code key)
{
struct session *sess = c->session;
struct options *oo = sess->options;
@ -1116,7 +1116,7 @@ status_prompt_key(struct client *c, int key)
status_prompt_clear(c);
break;
case MODEKEY_OTHER:
if ((key & 0xff00) != 0 || key < 32 || key == 127)
if (key <= 0x1f || key >= 0x7f)
break;
c->prompt_buffer = xrealloc(c->prompt_buffer, size + 2);