version 1.82, 2015/11/23 20:53:09 |
version 1.83, 2015/12/12 18:19:00 |
|
|
if (tk == NULL) { |
if (tk == NULL) { |
tk = *tkp = xcalloc(1, sizeof *tk); |
tk = *tkp = xcalloc(1, sizeof *tk); |
tk->ch = *s; |
tk->ch = *s; |
tk->key = KEYC_NONE; |
tk->key = KEYC_UNKNOWN; |
} |
} |
|
|
/* Find the next entry. */ |
/* Find the next entry. */ |
|
|
(*size)++; |
(*size)++; |
|
|
/* At the end of the string, return the current node. */ |
/* At the end of the string, return the current node. */ |
if (len == 0 || (tk->next == NULL && tk->key != KEYC_NONE)) |
if (len == 0 || (tk->next == NULL && tk->key != KEYC_UNKNOWN)) |
return (tk); |
return (tk); |
|
|
/* Move into the next tree for the following character. */ |
/* Move into the next tree for the following character. */ |
|
|
if (tk->next != NULL) |
if (tk->next != NULL) |
goto partial_key; |
goto partial_key; |
key = tk->key; |
key = tk->key; |
if (key != KEYC_NONE) |
if (key != KEYC_UNKNOWN) |
key |= KEYC_ESCAPE; |
key |= KEYC_ESCAPE; |
goto complete_key; |
goto complete_key; |
} |
} |
|
|
} |
} |
|
|
/* Fire the key. */ |
/* Fire the key. */ |
if (key != KEYC_NONE) |
if (key != KEYC_UNKNOWN) |
server_client_handle_key(tty->client, key); |
server_client_handle_key(tty->client, key); |
|
|
return (1); |
return (1); |