fixed problem with numeric binds

This commit is contained in:
Magnus Auvinen 2008-03-23 09:15:31 +00:00
parent c03f2a36e8
commit 1788d1b08c

View file

@ -229,9 +229,13 @@ void binds_set(int keyid, const char *str)
static int get_key_id(const char *key_name) static int get_key_id(const char *key_name)
{ {
int i = atoi(key_name); // check for numeric
if(i > 0 && i < KEY_LAST) if(key_name[0] == '#')
return i; // numeric {
int i = atoi(key_name+1);
if(i > 0 && i < KEY_LAST)
return i; // numeric
}
// search for key // search for key
for(int i = 0; i < KEY_LAST; i++) for(int i = 0; i < KEY_LAST; i++)