spotify-player icon indicating copy to clipboard operation
spotify-player copied to clipboard

Remap key to key combination

Open repparw opened this issue 2 years ago • 1 comments

I'm thinking how to bind y to the equivalent of 'a 5'. So, current song, copy link. I think either having it so you can bind to a sequence of commands, or bind a key to a sequence of keys would be nice. Something like [[keymaps]] command = "ShowActionsOnCurrentTrack; CopyTrackLink" key_sequence = "y" or [[keymaps]] command = "a 5" // maybe a different name instead of command? idk key_sequence = "y"

repparw avatar Apr 23 '24 19:04 repparw

It's better to define a separate mapping for actions, for example

[[actions]]
action = "GoToTrackRadio"
key = "r"

[[actions]]
action = "AddToLikedTracks"
key = "y"

aome510 avatar Apr 24 '24 02:04 aome510

I just started to take a look at the actions! Nice one. Unfortunately it seems it still doesnt allow to implement the example I gave? I can only for example copy the link of the current selection. I can't do the equivalent of 'a 5' right now. I'd need to go to currently playing context and select the song I'm playing for example and then use the CopyLink action. Unless I'm getting something wrong?

repparw avatar Jul 29 '24 21:07 repparw

Unfortunately it seems it still doesnt allow to implement the example I gave? I can only for example copy the link of the current selection. I can't do the equivalent of 'a 5' right now. I'd need to go to currently playing context and select the song I'm playing for example and then use the CopyLink action. Unless I'm getting something wrong?

Yeah, you're right. The current action only works on currently selected item. We can update action keymap to also support currently playing track, which can be configured by a new field ActionType

enum ActionType {
   PlayingTrack
   SelectedItem
}

cc @juliamertz is this something you're interested in working on as a follow-up?

aome510 avatar Jul 29 '24 21:07 aome510

cc @juliamertz is this something you're interested in working on as a follow-up?

Doesn't look like this would be too much work, i'll take a look at it when i get some time

juliamertz avatar Aug 04 '24 13:08 juliamertz

cc @juliamertz is this something you're interested in working on as a follow-up?

Doesn't look like this would be too much work, i'll take a look at it when i get some time

Great, thank you!

aome510 avatar Aug 04 '24 16:08 aome510