Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store shortcuts in config #129

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

JuliDi
Copy link
Contributor

@JuliDi JuliDi commented Aug 20, 2021

This is a first attempt at storing keyboard shortcuts in the config, following up on #111.
Ideally, if you open the preferences now, there is a "shortcuts" tab with some default settings. For now, either a single character (like "+" or "-" for the volume controls) or a Code as defined by https://docs.rs/keyboard-types/0.6.1/keyboard_types/enum.Code.html can be entered.

At the moment, the entries are only parsed and validated – I couldn't manage to get proper feedback (like an error message or so) back to the UI when the entered shortcut could not be parsed.

It doesn't seem very straightforward to implement those keyboard shortcuts and recording them by the user would be even better (and is on my todo list). Also, there are probably a lot of corner-cases that might be or become problematic.

So feedback on this is highly appreciated.

@JuliDi JuliDi marked this pull request as ready for review August 20, 2021 14:27
@jpochyla
Copy link
Owner

Thanks a lot for the PR @JuliDi. Do you think we really need to make the shortcuts configurable? i.e. what other shortcut sets would make sense?

@JuliDi
Copy link
Contributor Author

JuliDi commented Aug 29, 2021

Making them configurable might prove useful in the future if there are more actions that can have a shortcut (there might be people preferring the F-keys over arrow keys and characters etc). However, this might be my personal preference from using other programs.

Regarding other shortcuts, some ideas that come to mind:

  • liking a song
  • adding a song to the library
  • adding a song to the last used playlist
  • play selected song next (this would be good in combination with the ability to use arrow keys to navigate a playlist)
  • opening the containing album for the currently playing song
  • focus the search bar (i.e. you press "s" and then type the name of a song, no need to click anywhere)

@jpochyla jpochyla mentioned this pull request Sep 14, 2021
@jacksongoode
Copy link
Collaborator

Are some hotkeys already specified here - but they don't seem to work (at least on Linux)?

@JuliDi
Copy link
Contributor Author

JuliDi commented Dec 18, 2021

Are some hotkeys already specified here - but they don't seem to work (at least on Linux)?

I can confirm that this does not work with Ubuntu 20.04, might be related to this issue: linebender/druid#281
There is no real menu bar as e.g. in macOS and Windows, so that might be an issue.

@kataklasm
Copy link

I'd love to get configurable hotkeys as well. I'm using my computer without a mouse, just a keyboard. So being able to control Psst without using the mouse would be great. Few recommendations (based on vim control scheme):

focus search bar: /
focus sidebar: h
focus main panel: l
scroll down single line: j
scroll up single line: k
scroll down half page: ctrl-d
scroll up half page: ctrl-u
like song: a

but as mentioned before, these shortcuts should still be configurable by the user. Example usecase: I'm not using one of the usual keyboard layouts, so being able to set my own hotkeys would be great!

@JuliDi
Copy link
Contributor Author

JuliDi commented Jul 3, 2022

@kataklasm totally agree that there should be some good default bindings and they should be configurable by the user without changing the code and compiling the crate.

As far as I can tell, the issue on Linux with druid is still not resolved.
Maybe there is an alternative solution by now, but I am not really familiar with druid myself. If binding keys to menu entries is not possible on linux, there should be some alternative.
So if anyone has an idea how we could implement this, that would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants