diff options
author | Avi Halachmi (:avih) <avihpit@yahoo.com> | 2021-07-21 13:29:27 +0300 |
---|---|---|
committer | Avi Halachmi (:avih) <avihpit@yahoo.com> | 2021-07-21 17:29:11 +0300 |
commit | 7f4841ff39f2047bb2338cf2a17ce1ee860a2716 (patch) | |
tree | ae43fdbb533ca23d367eabf06a4bb861c34d93f9 /sub/draw_bmp.h | |
parent | 1d1d1fbff9648e9adf7acf571514abf618ffc40f (diff) | |
download | mpv-7f4841ff39f2047bb2338cf2a17ce1ee860a2716.tar.bz2 mpv-7f4841ff39f2047bb2338cf2a17ce1ee860a2716.tar.xz |
js: key bindings: ensure priorities for same-key bindings
Previously, if a script bound the same key more than once to different
functions (without removing the older bindings first), then pressing
the key triggered any of the bound functions arbitrarily[1].
Now the newest binding for the same key is always the active one.
If the newest binding is then removed - the second-newest will become
active, etc. (same mechanism as before, except that the active key
was not always the newest).
[1] The order was implementation-defined, however `for (name in obj)'
happens to iterate. With mujs that's currently alhabetic order,
and name is from mp.add_[forced_]key_binding(key, name...)
or generated internally if name is not provided. So a binding with
higher alphabetic `name' value had priority over lower name value.
Diffstat (limited to 'sub/draw_bmp.h')
0 files changed, 0 insertions, 0 deletions