diff options
author | albeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-02-04 14:48:32 +0000 |
---|---|---|
committer | albeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-02-04 14:48:32 +0000 |
commit | 490370037971b00640c953bab51df17059c0d969 (patch) | |
tree | 532749f7b667b4d92f257e9593153fe1037c6632 /input | |
parent | b1abc1a384081642b7eef756e2b398d58ee60fe4 (diff) | |
download | mpv-490370037971b00640c953bab51df17059c0d969.tar.bz2 mpv-490370037971b00640c953bab51df17059c0d969.tar.xz |
Tell the user when we fallback on default config.
Added some default joystick bindings
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4526 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'input')
-rw-r--r-- | input/input.c | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/input/input.c b/input/input.c index 4db77d280e..cd0f82a447 100644 --- a/input/input.c +++ b/input/input.c @@ -9,6 +9,7 @@ #include <errno.h> #include <signal.h> #include <sys/types.h> +#include <sys/time.h> #include <fcntl.h> @@ -160,6 +161,16 @@ static mp_cmd_bind_t def_cmd_binds[] = { { 'n', "tv_step_norm" }, { 'b', "tv_step_chanlist" }, #endif +#ifdef HAVE_JOYSTICK + { JOY_AXIS0_PLUS, "seek 10" }, + { JOY_AXIS0_MINUS, "seek -10" }, + { JOY_AXIS1_MINUS, "seek 60" }, + { JOY_AXIS1_PLUS, "seek -60" }, + { JOY_BTN0, "pause" }, + { JOY_BTN1, "osd" }, + { JOY_BTN2, "volume 1"}, + { JOY_BTN3, "volume -1"}, +#endif { 0, NULL } }; @@ -669,7 +680,7 @@ mp_input_free_binds(mp_cmd_bind_t* binds) { #define BS_MAX 256 #define SPACE_CHAR " \n\r\t" -static void +static int mp_input_parse_config(char *file) { int fd,code=-1; int bs = 0,r,eof = 0; @@ -682,7 +693,7 @@ mp_input_parse_config(char *file) { if(fd < 0) { printf("Can't open input config file %s : %s\n",file,strerror(errno)); - return; + return 0; } printf("Parsing input config file %s\n",file); @@ -696,7 +707,7 @@ mp_input_parse_config(char *file) { continue; printf("Error while reading input config file %s : %s\n",file,strerror(errno)); mp_input_free_binds(binds); - return; + return 0; } else if(r == 0) eof = 1; else { @@ -709,7 +720,7 @@ mp_input_parse_config(char *file) { printf("Input config file %s parsed : %d binds\n",file,n_binds); if(binds) cmd_binds = binds; - return; + return 1; } iter = buffer; @@ -733,7 +744,7 @@ mp_input_parse_config(char *file) { else printf("Buffer is too small for this key name : %s\n",iter); mp_input_free_binds(binds); - return; + return 0; } memmove(buffer,iter,end-iter); bs = end-iter; @@ -747,7 +758,7 @@ mp_input_parse_config(char *file) { if(code < 0) { printf("Unknow key %s\n",name); mp_input_free_binds(binds); - return; + return 0; } } if( bs > (end-buffer)) @@ -772,7 +783,7 @@ mp_input_parse_config(char *file) { if(iter == buffer) { printf("Buffer is too small for command %s\n",buffer); mp_input_free_binds(binds); - return; + return 0; } memmove(buffer,iter,end - iter); bs = end - iter; @@ -797,6 +808,7 @@ mp_input_parse_config(char *file) { } } printf("What are we doing here ?\n"); + return 0; } extern char *get_path(char *filename); @@ -809,7 +821,8 @@ mp_input_init(void) { if(!file) return; - mp_input_parse_config(file); + if(! mp_input_parse_config(file)) + printf("Falling back on default (hardcoded) config\n"); #ifdef HAVE_JOYSTICK { |