Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions usr/lib/hypnotix/hypnotix.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -1449,6 +1450,7 @@ def on_menu_quit(self, widget):
self.application.quit()

def on_key_press_event(self, widget, event):
channel_focused = self.fullscreen or "ChannelWidget" in widget.get_focus().get_name()
# Get any active, but not pressed modifiers, like CapsLock and NumLock
persistant_modifiers = Gtk.accelerator_get_default_mod_mask()

Expand Down Expand Up @@ -1481,6 +1483,11 @@ def on_key_press_event(self, widget, event):
self.on_prev_channel()
elif event.keyval == Gdk.KEY_Right:
self.on_next_channel()
return True
elif event.keyval == Gdk.KEY_space:
if channel_focused:
self.on_pause_button(widget)
return True
# elif event.keyval == Gdk.KEY_Up:
# # Up of in the list
# pass
Expand Down
Loading