Accept hex values as keys, needed for send-keys, based on a diff from

George Nachman.
pull/1/head
Nicholas Marriott 2012-03-04 20:40:54 +00:00
parent 30f4c30ca3
commit 178a20718c
1 changed files with 9 additions and 0 deletions

View File

@ -137,6 +137,15 @@ int
key_string_lookup_string(const char *string)
{
int key, modifiers;
u_short u;
int size;
/* Is this a hexadecimal value? */
if (string[0] == '0' && string[1] == 'x') {
if (sscanf(string + 2, "%hx%n", &u, &size) != 1 || size > 4)
return (KEYC_NONE);
return (u);
}
/* Check for modifiers. */
modifiers = 0;