Fixed TypeError: _handle_key_binding_message() signature incompatibility with mpv < v0.15.0
key-binding message has key name parameter only since mpv version 0.15.0 (as stated in manual), therefore trying to bind keys with earlier versions results in TypeError: _handle_key_binding_message() missing 1 required positional argument: 'key_name'. This change makes this argument optional and default to None.
This commit is contained in:
parent
4ebf4e1c37
commit
345ffb1998
1 changed files with 1 additions and 1 deletions
2
mpv.py
2
mpv.py
|
|
@ -993,7 +993,7 @@ class MPV(object):
|
|||
raise TypeError('register_key_binding expects either an str with an mpv command or a python callable.')
|
||||
self.command('enable-section', binding_name, 'allow-hide-cursor+allow-vo-dragging')
|
||||
|
||||
def _handle_key_binding_message(self, binding_name, key_state, key_name):
|
||||
def _handle_key_binding_message(self, binding_name, key_state, key_name=None):
|
||||
self._key_binding_handlers[binding_name](key_state, key_name)
|
||||
|
||||
def unregister_key_binding(self, keydef):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue