linuxmint / hypnotix

An M3U IPTV Player
1.25k stars 169 forks source link

Can set the UP DOWN keys as volume adjustment shortcut keys? #353

Closed wxzmz closed 1 month ago

wxzmz commented 1 month ago

Hypnotix is ​​almost entirely mouse-operated. If the IPTV player has infrared or Bluetooth remote control support, it is also quite good. The remote control generally has the following buttons: back return left right up down home volume_up volume_down But under pyhtony mpv, the volume shortcut keys are invalid. You can only activate osc with the mouse and adjust the volume with the scroll wheel. The remote control cannot be operated.

/usr/lib/hypnotix/hypnotix.py # elif event.keyval == Gdk.KEY_Up: # elif event.keyval == Gdk.KEY_Down:

KEY_Up KEY_Down is not used yet. Can it be used as a volume adjustment key? Can you please tell me how to unlock KEY_Up KEY_Down as a volume adjustment keyboard?

wxzmz commented 1 month ago

After some research Query /usr/include/gtk-3.0/gdk/gdkkeysyms.h Get the volume_up volume_down key values ​​corresponding to AudioRaiseVolume AudioLowerVolume

usr/lib/hypnotix/hypnotix.py adds the following

elif event.keyval == Gdk.KEY_AudioRaiseVolume: if self.stack.get_visible_child_name() == "channels_page": self.mpv.volume = min(self.mpv.volume + 10, 130) self.mpv.show_text("Volume " + self.mpv.osd.volume + "%" ) elif event.keyval == Gdk.KEY_AudioLowerVolume: if self.stack.get_visible_child_name() == "channels_page": self.mpv.volume = max(self.mpv.volume - 10, 0) self.mpv.show_text("Volume " + self.mpv.osd.volume + "%" )

elif event.keyval == Gdk.KEY_Up:

Up of in the list

pass