feat: show keyboard keys or the controller's own buttons in the hint bar

The hint bar always named Xbox buttons, so someone at a keyboard was
told to press buttons they did not have, and owners of other pads got
the wrong letters. Hints now name an action, and the keys or button
icons come from the input used last: keyboard, or an Xbox, PlayStation,
Switch or Steam Deck controller.

Behind Steam, every pad is Steam's virtual one. remus reads the file
Steam names in SteamVirtualGamepadInfo to find the physical controller,
matching the slot in the pad's name, as SDL does. Icons are Kenney's
Input Prompts (CC0), with the licence beside them.
This commit is contained in:
Ansho Rei
2026-11-04 10:43:56 +01:00
parent 8255e39047
commit 28a8b8af11
69 changed files with 902 additions and 71 deletions
+11
View File
@@ -56,6 +56,17 @@ fn step(ui: slint::Weak<AppWindow>, steps: Vec<String>, i: usize) {
Err(e) => log::error!("snapshot failed: {e}"),
}
}
Some(("prompts", kind)) => {
use crate::prompts::Family;
let family = match kind {
"xbox" => Some(Family::Xbox),
"playstation" => Some(Family::PlayStation),
"switch" => Some(Family::Switch),
"steamdeck" => Some(Family::SteamDeck),
_ => None,
};
app::with_app(move |app| app.pad_present(family));
}
Some(("login", creds)) => {
let mut parts = creds.splitn(3, '|').map(str::to_string);
let (url, user, pass) = (