Changed capture_mouse to be more generic (#180)

* Changed capture_mouse to triggered_menu

`capture_mouse` event occurs when spawning menu, it is not related directly to mouse. Therefore, `triggered_menu` is more general as this event can be used for various additions other than mouse capture in lua.

* Changed capture_mouse to triggered_menu

Renamed `capture_mouse` to `triggered_menu` 
`capture_mouse` event occurs when spawning menu, it is not related directly to mouse. Therefore, `triggered_menu` is more general as this event can be used for various additions other than mouse capture in lua.
This commit is contained in:
Eisa01 2021-03-20 23:53:56 +04:00 committed by GitHub
parent 86cda79084
commit a33bbc3f6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -125,7 +125,7 @@ class OSDMenu(object):
self.playerManager.set_osd_settings("#CC333333", 40)
self.playerManager.enable_osc(False)
self.playerManager.capture_mouse(True)
self.playerManager.triggered_menu(True)
self.menu_title = _("Main Menu")
self.menu_selection = 0
@ -199,7 +199,7 @@ class OSDMenu(object):
self.playerManager.show_text("", 0, 0)
self.playerManager.enable_osc(True)
self.playerManager.capture_mouse(False)
self.playerManager.triggered_menu(False)
self.playerManager.force_window(False)
if not self.playerManager.playback_is_aborted():

View File

@ -954,7 +954,7 @@ class PlayerManager(object):
if hasattr(self._player, "osc"):
self._player.osc = enabled
def capture_mouse(self, enabled: bool):
def triggered_menu(self, enabled: bool):
self._player.command(
"script-message", "shim-menu-enable", "True" if enabled else "False"
)