From 607d3e2e653f87f45812164cbaf4d5c7dcdcda1e Mon Sep 17 00:00:00 2001 From: egon984 Date: Sun, 7 Sep 2025 09:38:21 +0200 Subject: [PATCH 1/5] EXPERIMENTAL: forward keys to mpv keys not used by Hypnotix, like the spacebar, can be forwarded to mpv so you can natively use its shortcuts --- usr/lib/hypnotix/hypnotix.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usr/lib/hypnotix/hypnotix.py b/usr/lib/hypnotix/hypnotix.py index 4885ac5..94750a6 100755 --- a/usr/lib/hypnotix/hypnotix.py +++ b/usr/lib/hypnotix/hypnotix.py @@ -1481,6 +1481,9 @@ def on_key_press_event(self, widget, event): self.on_prev_channel() elif event.keyval == Gdk.KEY_Right: self.on_next_channel() + else: + self.mpv.command("keypress", Gdk.keyval_name(event.keyval)) + return True # elif event.keyval == Gdk.KEY_Up: # # Up of in the list # pass From 51cc1330296630403bcc01a141ece80b443709ca Mon Sep 17 00:00:00 2001 From: egon984 Date: Sun, 7 Sep 2025 10:00:27 +0200 Subject: [PATCH 2/5] arrows and SHIFT use L/R arrows with SHIFT to go back and forth in mpv --- usr/lib/hypnotix/hypnotix.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr/lib/hypnotix/hypnotix.py b/usr/lib/hypnotix/hypnotix.py index 94750a6..20d345b 100755 --- a/usr/lib/hypnotix/hypnotix.py +++ b/usr/lib/hypnotix/hypnotix.py @@ -1477,9 +1477,9 @@ def on_key_press_event(self, widget, event): elif event.keyval == Gdk.KEY_BackSpace and not ctrl and type(widget.get_focus()) != gi.repository.Gtk.SearchEntry: self.normal_mode() self.on_go_back_button() - elif event.keyval == Gdk.KEY_Left: + elif not shift and event.keyval == Gdk.KEY_Left: self.on_prev_channel() - elif event.keyval == Gdk.KEY_Right: + elif not shift and event.keyval == Gdk.KEY_Right: self.on_next_channel() else: self.mpv.command("keypress", Gdk.keyval_name(event.keyval)) From 31ea9a62df7edfb52dd5c520a96c01e0b9969695 Mon Sep 17 00:00:00 2001 From: egon984 Date: Sun, 7 Sep 2025 12:37:56 +0200 Subject: [PATCH 3/5] bugfix suppress error messages for keys mpv can't handle --- usr/lib/hypnotix/hypnotix.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr/lib/hypnotix/hypnotix.py b/usr/lib/hypnotix/hypnotix.py index 20d345b..af19c55 100755 --- a/usr/lib/hypnotix/hypnotix.py +++ b/usr/lib/hypnotix/hypnotix.py @@ -1482,7 +1482,10 @@ def on_key_press_event(self, widget, event): elif not shift and event.keyval == Gdk.KEY_Right: self.on_next_channel() else: - self.mpv.command("keypress", Gdk.keyval_name(event.keyval)) + try: + self.mpv.command("keypress", Gdk.keyval_name(event.keyval)) + except: + pass return True # elif event.keyval == Gdk.KEY_Up: # # Up of in the list From 1b4af11b894cde51334720d420315d4925e3ea72 Mon Sep 17 00:00:00 2001 From: Frederic Bontemps <35567681+egon984@users.noreply.github.com> Date: Thu, 11 Sep 2025 07:57:47 +0200 Subject: [PATCH 4/5] un-pause mpv before loading --- usr/lib/hypnotix/hypnotix.py | 1 + 1 file changed, 1 insertion(+) diff --git a/usr/lib/hypnotix/hypnotix.py b/usr/lib/hypnotix/hypnotix.py index af19c55..c13e8f6 100755 --- a/usr/lib/hypnotix/hypnotix.py +++ b/usr/lib/hypnotix/hypnotix.py @@ -876,6 +876,7 @@ def on_next_channel(self): def play_async(self, channel): if self.mpv is not None: self.mpv.stop() + self.mpv.pause = False print("CHANNEL: '%s' (%s)" % (channel.name, channel.url)) if channel is not None and channel.url is not None: # os.system("mpv --wid=%s %s &" % (self.wid, channel.url)) From 9e498b31356b30519ccf9861cd8dacb0ffebba76 Mon Sep 17 00:00:00 2001 From: Frederic Bontemps <35567681+egon984@users.noreply.github.com> Date: Sat, 27 Sep 2025 10:35:08 +0200 Subject: [PATCH 5/5] bugfix --- usr/lib/hypnotix/hypnotix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/lib/hypnotix/hypnotix.py b/usr/lib/hypnotix/hypnotix.py index c13e8f6..be2821e 100755 --- a/usr/lib/hypnotix/hypnotix.py +++ b/usr/lib/hypnotix/hypnotix.py @@ -1482,7 +1482,7 @@ def on_key_press_event(self, widget, event): self.on_prev_channel() elif not shift and event.keyval == Gdk.KEY_Right: self.on_next_channel() - else: + elif not event.keyval in [Gdk.KEY_F1, Gdk.KEY_F2]: try: self.mpv.command("keypress", Gdk.keyval_name(event.keyval)) except: