comparison input/input.c @ 33306:37e215798390

Fix output of "No bind found for key" to actually make sense for key combinations and match the binding you'd have to add to input.conf also for these. Previously the extra keys would end up appended at the end, resulting in output like > No bind found for key 'MOUSE_BTN0'.-MOUSE_BTN2 and even worse for some translations.
author reimar
date Sat, 07 May 2011 11:11:07 +0000
parents d63bf64a2094
children 77bf38091051
comparison
equal deleted inserted replaced
33305:ddb45e9443ec 33306:37e215798390
1088 cmd = mp_input_find_bind_for_key(cmd_binds_default,n,keys); 1088 cmd = mp_input_find_bind_for_key(cmd_binds_default,n,keys);
1089 if(default_bindings && cmd == NULL) 1089 if(default_bindings && cmd == NULL)
1090 cmd = mp_input_find_bind_for_key(def_cmd_binds,n,keys); 1090 cmd = mp_input_find_bind_for_key(def_cmd_binds,n,keys);
1091 1091
1092 if(cmd == NULL) { 1092 if(cmd == NULL) {
1093 mp_msg(MSGT_INPUT,MSGL_WARN,MSGTR_NoBindFound,mp_input_get_key_name(keys[0])); 1093 char key_name[100];
1094 if(n > 1) { 1094 int i;
1095 int s; 1095 av_strlcpy(key_name, mp_input_get_key_name(keys[0]), sizeof(key_name));
1096 for(s=1; s < n; s++) 1096 for (i = 1; i < n; i++) {
1097 mp_msg(MSGT_INPUT,MSGL_WARN,"-%s",mp_input_get_key_name(keys[s])); 1097 av_strlcat(key_name, "-", sizeof(key_name));
1098 } 1098 av_strlcat(key_name, mp_input_get_key_name(keys[i]), sizeof(key_name));
1099 mp_msg(MSGT_INPUT,MSGL_WARN," \n"); 1099 }
1100 mp_msg(MSGT_INPUT,MSGL_WARN,MSGTR_NoBindFound,key_name);
1100 return NULL; 1101 return NULL;
1101 } 1102 }
1102 if (strcmp(cmd, "ignore") == 0) return NULL; 1103 if (strcmp(cmd, "ignore") == 0) return NULL;
1103 ret = mp_input_parse_cmd(cmd); 1104 ret = mp_input_parse_cmd(cmd);
1104 if(!ret) { 1105 if(!ret) {