Support screenshots

This commit is contained in:
2025-07-13 00:45:10 -04:00
parent f1658619ad
commit b6b0a8c22b
3 changed files with 95 additions and 8 deletions
+8 -1
View File
@@ -471,11 +471,12 @@ pub enum Command {
FastForward(u32),
Reset,
PauseResume,
Screenshot,
// if you update this, update Command::all and add a default
}
impl Command {
pub fn all() -> [Self; 6] {
pub fn all() -> [Self; 7] {
[
Self::OpenRom,
Self::Quit,
@@ -483,6 +484,7 @@ impl Command {
Self::Reset,
Self::FrameAdvance,
Self::FastForward(0),
Self::Screenshot,
]
}
@@ -494,6 +496,7 @@ impl Command {
Self::Reset => "Reset",
Self::FrameAdvance => "Frame Advance",
Self::FastForward(_) => "Fast Forward",
Self::Screenshot => "Screenshot",
}
}
}
@@ -539,6 +542,10 @@ impl Default for Shortcuts {
Command::FastForward(0),
KeyboardShortcut::new(Modifiers::NONE, Key::Space),
);
shortcuts.set(
Command::Screenshot,
KeyboardShortcut::new(Modifiers::NONE, Key::F12),
);
shortcuts
}
}