| 406 | } |
| 407 | |
| 408 | void EditorNode::shortcut_input(const Ref<InputEvent> &p_event) { |
| 409 | ERR_FAIL_COND(p_event.is_null()); |
| 410 | |
| 411 | Ref<InputEventKey> k = p_event; |
| 412 | if ((k.is_valid() && k->is_pressed() && !k->is_echo()) || Object::cast_to<InputEventShortcut>(*p_event)) { |
| 413 | bool is_handled = true; |
| 414 | if (ED_IS_SHORTCUT("editor/filter_files", p_event)) { |
| 415 | FileSystemDock::get_singleton()->focus_on_filter(); |
| 416 | } else if (ED_IS_SHORTCUT("editor/editor_2d", p_event)) { |
| 417 | editor_main_screen->select(EditorMainScreen::EDITOR_2D); |
| 418 | } else if (ED_IS_SHORTCUT("editor/editor_3d", p_event)) { |
| 419 | editor_main_screen->select(EditorMainScreen::EDITOR_3D); |
| 420 | } else if (ED_IS_SHORTCUT("editor/editor_script", p_event)) { |
| 421 | editor_main_screen->select(EditorMainScreen::EDITOR_SCRIPT); |
| 422 | } else if (ED_IS_SHORTCUT("editor/editor_game", p_event)) { |
| 423 | editor_main_screen->select(EditorMainScreen::EDITOR_GAME); |
| 424 | } else if (ED_IS_SHORTCUT("editor/editor_help", p_event)) { |
| 425 | emit_signal(SNAME("request_help_search"), ""); |
| 426 | } else if (ED_IS_SHORTCUT("editor/editor_assetlib", p_event) && AssetLibraryEditorPlugin::is_available()) { |
| 427 | editor_main_screen->select(EditorMainScreen::EDITOR_ASSETLIB); |
| 428 | } else if (ED_IS_SHORTCUT("editor/editor_next", p_event)) { |
| 429 | editor_main_screen->select_next(); |
| 430 | } else if (ED_IS_SHORTCUT("editor/editor_prev", p_event)) { |
| 431 | editor_main_screen->select_prev(); |
| 432 | } else if (ED_IS_SHORTCUT("editor/command_palette", p_event)) { |
| 433 | _open_command_palette(); |
| 434 | } else if (ED_IS_SHORTCUT("editor/toggle_last_opened_bottom_panel", p_event)) { |
| 435 | bottom_panel->toggle_last_opened_bottom_panel(); |
| 436 | } else { |
| 437 | is_handled = false; |
| 438 | } |
| 439 | |
| 440 | if (is_handled) { |
| 441 | get_tree()->get_root()->set_input_as_handled(); |
| 442 | } |
| 443 | } |
| 444 | } |
| 445 | |
| 446 | void EditorNode::_update_vsync_mode() { |
| 447 | const DisplayServer::VSyncMode window_vsync_mode = DisplayServer::VSyncMode(int(EDITOR_GET("interface/editor/vsync_mode"))); |
nothing calls this directly
no test coverage detected