MCPcopy Create free account
hub / github.com/PerroEngine/Perro / update_editor_shortcuts

Function update_editor_shortcuts

perro_editor/res/scripts/scene/editor_nav.rs:109–520  ·  view source on GitHub ↗
(ctx: &mut ScriptContext<'_, API>)

Source from the content-addressed store, hash-verified

107 }
108 if key_pressed!(ctx.ipt, KeyCode::Enter) && commit_focused_inspector_box(ctx) {
109 return;
110 }
111 if ctrl && shift && !alt && key_pressed!(ctx.ipt, KeyCode::KeyP) {
112 set_command_palette(ctx, true);
113 return;
114 }
115 if editor_text_box_has_focus(ctx) {
116 return;
117 }
118 if ctrl && shift && !alt && key_pressed!(ctx.ipt, KeyCode::F11) {
119 toggle_distraction_free(ctx);
120 return;
121 }
122 let picker_open = with_state!(ctx.run, EditorState, ctx.id, |state| {
123 state.add_node_popup_open
124 }).unwrap_or_default();
125 if !picker_open
126 && ctrl
127 && !alt
128 && (key_pressed!(ctx.ipt, KeyCode::KeyY) || (shift && key_pressed!(ctx.ipt, KeyCode::KeyZ)))
129 {
130 redo_active_scene(ctx);
131 return;
132 }
133 if !picker_open && ctrl && !alt && !shift && key_pressed!(ctx.ipt, KeyCode::KeyZ) {
134 undo_active_scene(ctx);
135 return;
136 }
137 if picker_open && key_pressed!(ctx.ipt, KeyCode::ArrowUp) {
138 nudge_node_picker(ctx, -1);
139 return;
140 }
141 if picker_open && key_pressed!(ctx.ipt, KeyCode::ArrowDown) {
142 nudge_node_picker(ctx, 1);
143 return;
144 }
145 if picker_open && key_pressed!(ctx.ipt, KeyCode::PageUp) {
146 shift_node_picker(ctx, -1);
147 return;
148 }
149 if picker_open && key_pressed!(ctx.ipt, KeyCode::PageDown) {
150 shift_node_picker(ctx, 1);
151 return;
152 }
153 if picker_open && key_pressed!(ctx.ipt, KeyCode::Home) {
154 set_node_picker_edge(ctx, false);
155 return;
156 }
157 if picker_open && key_pressed!(ctx.ipt, KeyCode::End) {
158 set_node_picker_edge(ctx, true);
159 return;
160 }
161 if picker_open && key_pressed!(ctx.ipt, KeyCode::Enter) {
162 add_node_from_picker(ctx, 0);
163 return;
164 }
165 if picker_open && !ctrl && key_pressed!(ctx.ipt, KeyCode::Tab) {
166 toggle_add_node_insert_mode(ctx);

Callers

nothing calls this directly

Calls 15

handle_editor_escapeFunction · 0.85
redo_active_sceneFunction · 0.85
undo_active_sceneFunction · 0.85
nudge_node_pickerFunction · 0.85
shift_node_pickerFunction · 0.85
set_node_picker_edgeFunction · 0.85
add_node_from_pickerFunction · 0.85
nav_sidebar_parentFunction · 0.85

Tested by

no test coverage detected