[Mplayer-cvslog] CVS: main/input input.c,1.36,1.37
Alban Bedel CVS
albeu at mplayerhq.hu
Wed Jun 12 12:39:06 CEST 2002
- Previous message: [Mplayer-cvslog] CVS: main/DOCS/Hungarian bugreports.html,1.19,1.20 cd-dvd.html,1.28,1.29 codecs.html,1.47,1.48 documentation.html,1.146,1.147 encoding.html,1.31,1.32 faq.html,1.55,1.56 formats.html,1.20,1.21 sound.html,1.29,1.30 video.html,1.57,1.58
- Next message: [Mplayer-cvslog] CVS: main/DOCS skin-en.html,1.2,1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/mplayer/main/input
In directory mail:/var/tmp.root/cvs-serv28948/input
Modified Files:
input.c
Log Message:
Add support for hex key code in input.conf
Index: input.c
===================================================================
RCS file: /cvsroot/mplayer/main/input/input.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- input.c 6 Jun 2002 07:13:56 -0000 1.36
+++ input.c 12 Jun 2002 10:39:04 -0000 1.37
@@ -11,6 +11,7 @@
#include <sys/types.h>
#include <sys/time.h>
#include <fcntl.h>
+#include <ctype.h>
#include "input.h"
#include "mouse.h"
@@ -963,7 +964,7 @@
return ret;
}
-static char key_str[2];
+static char key_str[12];
static char*
mp_input_get_key_name(int key) {
@@ -974,21 +975,25 @@
return key_names[i].name;
}
- if(key >> 8 == 0) {
- snprintf(key_str,2,"%c",(char)key);
+ if(isascii(key)) {
+ snprintf(key_str,12,"%c",(char)key);
return key_str;
}
- return NULL;
+ // Print the hex key code
+ snprintf(key_str,12,"%#-8x",key);
+ return key_str;
+
}
static int
mp_input_get_key_from_name(char* name) {
- int i,ret = 0;
- if(strlen(name) == 1) { // Direct key code
- (char)ret = name[0];
+ int i,ret = 0,len = strlen(name);
+ if(len == 1) { // Direct key code
+ ret = (unsigned char)name[0];
return ret;
- }
+ } else if(len > 2 && strncasecmp("0x",name,2) == 0)
+ return strtol(name,NULL,16);
for(i = 0; key_names[i].name != NULL; i++) {
if(strcasecmp(key_names[i].name,name) == 0)
- Previous message: [Mplayer-cvslog] CVS: main/DOCS/Hungarian bugreports.html,1.19,1.20 cd-dvd.html,1.28,1.29 codecs.html,1.47,1.48 documentation.html,1.146,1.147 encoding.html,1.31,1.32 faq.html,1.55,1.56 formats.html,1.20,1.21 sound.html,1.29,1.30 video.html,1.57,1.58
- Next message: [Mplayer-cvslog] CVS: main/DOCS skin-en.html,1.2,1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the MPlayer-cvslog
mailing list