mirror of https://github.com/mpv-player/mpv
js: mp.add_key_binding: allow false-y name (match 311cc5b
)
This is in addition to the allowed omission of name and/or flags (as documented).
This commit is contained in:
parent
abf6b22abd
commit
b67d124dc0
|
@ -204,8 +204,10 @@ function add_binding(forced, key, name, fn, opts) {
|
||||||
if (typeof name == "function") { // as if "name" is not part of the args
|
if (typeof name == "function") { // as if "name" is not part of the args
|
||||||
opts = fn;
|
opts = fn;
|
||||||
fn = name;
|
fn = name;
|
||||||
name = "__keybinding" + next_bid++; // new unique binding name
|
name = false;
|
||||||
}
|
}
|
||||||
|
if (!name)
|
||||||
|
name = "__keybinding" + next_bid++; // new unique binding name
|
||||||
var key_data = {forced: forced};
|
var key_data = {forced: forced};
|
||||||
switch (typeof opts) { // merge opts into key_data
|
switch (typeof opts) { // merge opts into key_data
|
||||||
case "string": key_data[opts] = true; break;
|
case "string": key_data[opts] = true; break;
|
||||||
|
|
Loading…
Reference in New Issue