[PR #129] Store shortcuts in config #437

Open
opened 2026-02-28 14:33:00 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jpochyla/psst/pull/129
Author: @JuliDi
Created: 8/20/2021
Status: 🔄 Open

Base: mainHead: store-shortcuts-in-config


📝 Commits (5)

  • 21f3856 first draft of kb shortcut in config
  • 89f57dd change kbshortcuts to be stored as string for compativility with text
  • f554d4a finish draft of settings screen for shortcuts
  • 9e10900 cleanup code, add more doc
  • 6a0ef23 remove souvlaki dep from git

📊 Changes

10 files changed (+283 additions, -17 deletions)

View changed files

📝 Cargo.lock (+6 -6)
📝 psst-gui/src/controller/input.rs (+27 -0)
📝 psst-gui/src/controller/mod.rs (+2 -0)
📝 psst-gui/src/controller/playback.rs (+7 -6)
psst-gui/src/controller/shortcut_formatter.rs (+30 -0)
📝 psst-gui/src/data/config.rs (+57 -0)
psst-gui/src/data/kbshortcut.rs (+90 -0)
📝 psst-gui/src/data/mod.rs (+5 -1)
📝 psst-gui/src/ui/mod.rs (+2 -1)
📝 psst-gui/src/ui/preferences.rs (+57 -3)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jpochyla/psst/pull/129 **Author:** [@JuliDi](https://github.com/JuliDi) **Created:** 8/20/2021 **Status:** 🔄 Open **Base:** `main` ← **Head:** `store-shortcuts-in-config` --- ### 📝 Commits (5) - [`21f3856`](https://github.com/jpochyla/psst/commit/21f385636db73888c3206ef588f5d3a24c29f959) first draft of kb shortcut in config - [`89f57dd`](https://github.com/jpochyla/psst/commit/89f57dd811c4d89a8091a1f854c3f00bdb5b78a6) change kbshortcuts to be stored as string for compativility with text - [`f554d4a`](https://github.com/jpochyla/psst/commit/f554d4aae43a21b1b8a38a7db19151e46045ae53) finish draft of settings screen for shortcuts - [`9e10900`](https://github.com/jpochyla/psst/commit/9e10900008748e4114b576e772c34ec64a38eb55) cleanup code, add more doc - [`6a0ef23`](https://github.com/jpochyla/psst/commit/6a0ef230774365c6204e79e9416117867d6ec888) remove souvlaki dep from git ### 📊 Changes **10 files changed** (+283 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+6 -6) 📝 `psst-gui/src/controller/input.rs` (+27 -0) 📝 `psst-gui/src/controller/mod.rs` (+2 -0) 📝 `psst-gui/src/controller/playback.rs` (+7 -6) ➕ `psst-gui/src/controller/shortcut_formatter.rs` (+30 -0) 📝 `psst-gui/src/data/config.rs` (+57 -0) ➕ `psst-gui/src/data/kbshortcut.rs` (+90 -0) 📝 `psst-gui/src/data/mod.rs` (+5 -1) 📝 `psst-gui/src/ui/mod.rs` (+2 -1) 📝 `psst-gui/src/ui/preferences.rs` (+57 -3) </details> ### 📄 Description 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/psst#437
No description provided.