Repository: aome510/spotify-player (language: rust)

Issue:
Remap / rebind keymap to action
**Describe the bug**
It does not seem possible to remap a kemap (like C-p which is bind to "SelectPreviousOrScrollUp") to an action (like "AddToPlaylist").

**To Reproduce**
I have this **keymap.toml**

```
[[keymaps]]
command = "SelectPreviousOrScrollUp"
key_sequence = "k"

[[actions]]
action = "AddToPlaylist"
key_sequence = "C-p"
```

**Expected behaviour**
SelectPreviousOrScrollUp is k
AddToPlaylist is C-p

**Environment**

- OS: Linux Fedora 40
- Application version: 0.19.1


Discussion / hints:
Besides, why do we make a difference between a keymap and an action?
> Besides, why do we make a difference between a keymap and an action?

I think you mean `command` and `action`. The difference is that `action` performs on a specific item (input) while `command` is supposed to be a general operation w/o input.
Oh ok, I see, thank you !
You can bind `C-p` to an action by binding `C-p` to `command = "None"` to allow re-use the key.
I did try that, but then C-p is just not bind to anything

```
[[keymaps]]
command = "SelectPreviousOrScrollUp"
key_sequence = "k"

[[keymaps]]
command = "None"
key_sequence = "C-p"

[[actions]]
action = "AddToPlaylist"
key_sequence = "C-p"
```
I see, then it's bug that doesn't allow to re-use `None` command. It should be easy to update https://github.com/aome510/spotify-player/blob/58a5ace777293ed04fb0da44075a27d777822501/spotify_player/src/config/keymap.rs#L416 to ignore `None` command.

Fix patch:
diff --git a/spotify_player/src/config/keymap.rs b/spotify_player/src/config/keymap.rs
index 9eac25fb..452a43bf 100644
--- a/spotify_player/src/config/keymap.rs
+++ b/spotify_player/src/config/keymap.rs
@@ -396,7 +396,7 @@ impl KeymapConfig {
     pub fn find_command_from_key_sequence(&self, key_sequence: &KeySequence) -> Option<Command> {
         self.keymaps
             .iter()
-            .find(|&keymap| keymap.key_sequence == *key_sequence)
+            .find(|&keymap| keymap.key_sequence == *key_sequence && keymap.command != Command::None)
             .map(|keymap| keymap.command)
     }
 


Test patch: