[MPlayer-cvslog] r33393 - in trunk: help/help_mp-cs.h help/help_mp-de.h help/help_mp-en.h help/help_mp-es.h help/help_mp-fr.h help/help_mp-hu.h help/help_mp-it.h help/help_mp-pl.h help/help_mp-ru.h help/help_mp-sk....

reimar subversion at mplayerhq.hu
Sat May 7 13:11:07 CEST 2011


Author: reimar
Date: Sat May  7 13:11:07 2011
New Revision: 33393

Log:
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.

Modified:
   trunk/input/input.c

Changes in other areas also in this revision:
Modified:
   trunk/help/help_mp-cs.h
   trunk/help/help_mp-de.h
   trunk/help/help_mp-en.h
   trunk/help/help_mp-es.h
   trunk/help/help_mp-fr.h
   trunk/help/help_mp-hu.h
   trunk/help/help_mp-it.h
   trunk/help/help_mp-pl.h
   trunk/help/help_mp-ru.h
   trunk/help/help_mp-sk.h
   trunk/help/help_mp-tr.h
   trunk/help/help_mp-zh_CN.h
   trunk/help/help_mp-zh_TW.h

Modified: trunk/input/input.c
==============================================================================
--- trunk/input/input.c	Sat May  7 12:59:11 2011	(r33392)
+++ trunk/input/input.c	Sat May  7 13:11:07 2011	(r33393)
@@ -1090,13 +1090,14 @@ mp_input_get_cmd_from_keys(int n,int* ke
     cmd = mp_input_find_bind_for_key(def_cmd_binds,n,keys);
 
   if(cmd == NULL) {
-    mp_msg(MSGT_INPUT,MSGL_WARN,MSGTR_NoBindFound,mp_input_get_key_name(keys[0]));
-    if(n > 1) {
-      int s;
-      for(s=1; s < n; s++)
-	mp_msg(MSGT_INPUT,MSGL_WARN,"-%s",mp_input_get_key_name(keys[s]));
+    char key_name[100];
+    int i;
+    av_strlcpy(key_name, mp_input_get_key_name(keys[0]), sizeof(key_name));
+    for (i = 1; i < n; i++) {
+      av_strlcat(key_name, "-", sizeof(key_name));
+      av_strlcat(key_name, mp_input_get_key_name(keys[i]), sizeof(key_name));
     }
-    mp_msg(MSGT_INPUT,MSGL_WARN,"                         \n");
+    mp_msg(MSGT_INPUT,MSGL_WARN,MSGTR_NoBindFound,key_name);
     return NULL;
   }
   if (strcmp(cmd, "ignore") == 0) return NULL;


More information about the MPlayer-cvslog mailing list