make keyboard shortcuts configurable
This commit is contained in:
@@ -246,6 +246,8 @@ pub struct SharedPaneState<'a> {
|
||||
/// Set by panes (e.g. piano roll) when they handle Ctrl+C/X/V internally,
|
||||
/// so main.rs skips its own clipboard handling for the current frame
|
||||
pub clipboard_consumed: &'a mut bool,
|
||||
/// Remappable keyboard shortcut manager
|
||||
pub keymap: &'a crate::keymap::KeymapManager,
|
||||
/// Test mode state for event recording (debug builds only)
|
||||
#[cfg(debug_assertions)]
|
||||
pub test_mode: &'a mut crate::test_mode::TestModeState,
|
||||
|
||||
@@ -3087,7 +3087,7 @@ impl crate::panes::PaneRenderer for NodeGraphPane {
|
||||
// Handle pane-local keyboard shortcuts (only when pointer is over this pane)
|
||||
if ui.rect_contains_pointer(rect) {
|
||||
let ctrl_g = ui.input(|i| {
|
||||
i.key_pressed(egui::Key::G) && (i.modifiers.ctrl || i.modifiers.command)
|
||||
shared.keymap.action_pressed(crate::keymap::AppAction::NodeGraphGroup, i)
|
||||
});
|
||||
if ctrl_g && !self.state.selected_nodes.is_empty() {
|
||||
self.group_selected_nodes(shared);
|
||||
@@ -3095,7 +3095,7 @@ impl crate::panes::PaneRenderer for NodeGraphPane {
|
||||
|
||||
// Ctrl+Shift+G to ungroup
|
||||
let ctrl_shift_g = ui.input(|i| {
|
||||
i.key_pressed(egui::Key::G) && (i.modifiers.ctrl || i.modifiers.command) && i.modifiers.shift
|
||||
shared.keymap.action_pressed(crate::keymap::AppAction::NodeGraphUngroup, i)
|
||||
});
|
||||
if ctrl_shift_g {
|
||||
// Ungroup any selected group placeholders
|
||||
@@ -3108,7 +3108,7 @@ impl crate::panes::PaneRenderer for NodeGraphPane {
|
||||
}
|
||||
|
||||
// F2 to rename selected group
|
||||
let f2 = ui.input(|i| i.key_pressed(egui::Key::F2));
|
||||
let f2 = ui.input(|i| shared.keymap.action_pressed(crate::keymap::AppAction::NodeGraphRename, i));
|
||||
if f2 && self.renaming_group.is_none() {
|
||||
// Find the first selected group placeholder
|
||||
if let Some(group_id) = self.state.selected_nodes.iter()
|
||||
|
||||
@@ -725,7 +725,7 @@ impl PianoRollPane {
|
||||
}
|
||||
|
||||
// Delete key
|
||||
let delete_pressed = ui.input(|i| i.key_pressed(egui::Key::Delete) || i.key_pressed(egui::Key::Backspace));
|
||||
let delete_pressed = ui.input(|i| shared.keymap.action_pressed_with_backspace(crate::keymap::AppAction::PianoRollDelete, i));
|
||||
if delete_pressed && !self.selected_note_indices.is_empty() {
|
||||
if let Some(clip_id) = self.selected_clip_id {
|
||||
self.delete_selected_notes(clip_id, shared, clip_data);
|
||||
|
||||
@@ -6033,7 +6033,7 @@ impl StagePane {
|
||||
{ self.replay_override = None; }
|
||||
|
||||
// Delete/Backspace: remove selected DCEL elements
|
||||
if ui.input(|i| i.key_pressed(egui::Key::Delete) || i.key_pressed(egui::Key::Backspace)) {
|
||||
if ui.input(|i| shared.keymap.action_pressed_with_backspace(crate::keymap::AppAction::StageDelete, i)) {
|
||||
if shared.selection.has_dcel_selection() {
|
||||
if let Some(active_layer_id) = *shared.active_layer_id {
|
||||
let time = *shared.playback_time;
|
||||
|
||||
Reference in New Issue
Block a user