ravachol / kew

A command-line music player
GNU General Public License v2.0
527 stars 19 forks source link

Allow binding other keys for kew modes (F2-F5) #144

Closed Kabouik closed 2 weeks ago

Kabouik commented 2 weeks ago

Pretty much what the title says. It'd be nice to be able to remap modes corresponding to Function keys (F2-F4) to something else, like qwer, ^2 ^3 ^3 ^4 ^5, or whatever, and with some minimal keyboards, it'd actually be very useful.

Love kew by the way, as a ncmcpp user, I'm very happy to have found this alternative. I just wish there was a way to resume playback where it was stopped (i.e., current position in playlist and current position in song); which would also be useful for audiobooks.

ravachol commented 2 weeks ago

Hi Kabouik, glad you like kew!

The first one yes, probably, but how would this be implemented? ctrl + 2 for instance is equal to "\x02". Most people don't know that.

The second one...I don't think I'm going to do that as it involves saving the full state of the player including playlist somewhere.

I consider kew mostly feature complete and I'm trying to prevent it from swelling out of control like so many programs do. Then 5 years later nobody wants to use it because it's slow and bloated and has a million features that are just confusing for new users.

Kabouik commented 2 weeks ago

Given that digits are already used in conjunction with Enter to jump to a song in the playlist, I believe this implies that digit keys keep this special behaviour whereby they do not readily trigger an action, but instead are prefixes to the Enter key. Therefore I think one could only use non-digit keys, or digit keys combined with a modifier, I agree.

This would require bindings to be set in the kewrc using their code shown by showkey indeed, but I think this would be fine, plus the binding system already supports such keys and the configuration file already explains to the user how to get the codes. What is missing is customizable keybindings for those main pages, and adding them in the configuration I guess.

I totally understand for the second thing and I think you make a great point. For audiobooks, I think I'll just stick with mpv for the time being, as it just is a great way to play audiobooks and resume playback where it was stopped. Its short, medium and long seek jumps also work great with audiobooks.

Resuming the last position in the playlist would be a welcome feature for many music listeners I believe (I know I find myself frustrated if my playlist progress is lost upon quitting the program), but any stance on that is totally fine and has pros and cons.

ravachol commented 2 weeks ago

Ok, that's not a problem to add. I have 2 key codes set for F2 etc, so all I need to do then is add a third key code that is available in the config.

ravachol commented 2 weeks ago

Alternative keys for the main views have been added to the develop branch. However I didn't do the Ctrl+3 etc stuff, among other things because Ctrl+3 is the same as Esc key in my setup and will quit the program.

Kabouik commented 2 weeks ago

Thanks!

ravachol commented 2 weeks ago

np.