summaryrefslogtreecommitdiffstats
path: root/input
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-03-14 23:52:45 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-03-14 23:52:45 +0200
commitae2faad6669c313b7a5dd318baeee0bffdd47031 (patch)
tree0b383b5dde56d54be4b144e7e23e96bd8bdd43cf /input
parentb93f4b7bba0e31d157b74685d3166f74a6c244d7 (diff)
parent642162c07460e439d1d81cda4643dc028ed238e0 (diff)
downloadmpv-ae2faad6669c313b7a5dd318baeee0bffdd47031.tar.bz2
mpv-ae2faad6669c313b7a5dd318baeee0bffdd47031.tar.xz
Merge svn changes up to r28951
Diffstat (limited to 'input')
-rw-r--r--input/input.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/input/input.c b/input/input.c
index 1f1d4a6ebf..66c245071d 100644
--- a/input/input.c
+++ b/input/input.c
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
+#include <stdbool.h>
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>
@@ -582,6 +583,7 @@ struct input_ctx {
unsigned int num_key_down;
unsigned int last_key_down;
+ bool default_binds;
// List of command binding sections
mp_cmd_bind_section_t *cmd_bind_sections;
// Name of currently used command section
@@ -621,6 +623,8 @@ static const m_option_t input_conf[] = {
OPT_STRING("js-dev", input.js_dev, CONF_GLOBAL),
OPT_STRING("ar-dev", input.ar_dev, CONF_GLOBAL),
OPT_STRING("file", input.in_file, CONF_GLOBAL),
+ OPT_FLAG_ON("default-binds", input.default_binds, CONF_GLOBAL),
+ OPT_FLAG_OFF("nodefault-binds", input.default_binds, CONF_GLOBAL),
{ NULL, NULL, 0, 0, 0, 0, NULL}
};
@@ -1059,7 +1063,7 @@ static mp_cmd_t *get_cmd_from_keys(struct input_ctx *ictx, int n, int *keys,
cmd = find_bind_for_key(ictx->cmd_binds, n, keys);
if (ictx->cmd_binds_default && cmd == NULL)
cmd = find_bind_for_key(ictx->cmd_binds_default, n, keys);
- if(cmd == NULL)
+ if (ictx->default_binds && cmd == NULL)
cmd = find_bind_for_key(def_cmd_binds,n,keys);
if(cmd == NULL) {
@@ -1694,6 +1698,7 @@ struct input_ctx *mp_input_init(struct input_conf *input_conf, int use_gui)
.ar_state = -1,
.ar_delay = input_conf->ar_delay,
.ar_rate = input_conf->ar_rate,
+ .default_binds = input_conf->default_binds,
};
char* file;