generated from GarandPLG/rust-flake-template
Rename GameStates to States and adjust keybindings
Replace the old `GameStates` struct with a new `states` module, rename the field in `App` to `states`, and update construction to pass CLI args. Remove the now‑unused `game_states.rs` file and adjust imports accordingly. Update keybinding definitions: change the wildcard symbol to "[All]" and simplify the wildcard detection logic by dropping the modifiers check.
This commit is contained in:
@@ -112,7 +112,7 @@ pub static KEYBINDINGS: &[KeyBinding] = &[
|
||||
kind: KeyEventKind::Press,
|
||||
modifiers: KeyModifiers::NONE,
|
||||
group: Group::Input,
|
||||
symbol: "*",
|
||||
symbol: "[All]",
|
||||
description: "All keyboard characters",
|
||||
},
|
||||
];
|
||||
@@ -129,11 +129,10 @@ pub fn event_to_action(event: &KeyEvent) -> Option<Action> {
|
||||
return Some(b.action);
|
||||
}
|
||||
|
||||
if KEYBINDINGS.iter().any(|b| {
|
||||
matches!(b.action, Action::WildCard(_))
|
||||
&& b.kind == event.kind
|
||||
&& b.modifiers == event.modifiers
|
||||
}) {
|
||||
if KEYBINDINGS
|
||||
.iter()
|
||||
.any(|b| matches!(b.action, Action::WildCard(_)) && b.kind == event.kind)
|
||||
{
|
||||
if let KeyCode::Char(c) = event.code {
|
||||
return Some(Action::WildCard(c));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user