File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -2384,9 +2384,23 @@ void ScriptEditor::_unhandled_input(const Ref<InputEvent> &p_event) {
23842384void ScriptEditor::_script_list_gui_input (const Ref<InputEvent> &ev) {
23852385
23862386 Ref<InputEventMouseButton> mb = ev;
2387- if (mb.is_valid () && mb->get_button_index () == BUTTON_RIGHT && mb->is_pressed ()) {
2387+ if (mb.is_valid () && mb->is_pressed ()) {
2388+ switch (mb->get_button_index ()) {
2389+
2390+ case BUTTON_MIDDLE: {
2391+ // Right-click selects automatically; middle-click does not.
2392+ int idx = script_list->get_item_at_position (mb->get_position (), true );
2393+ if (idx >= 0 ) {
2394+ script_list->select (idx);
2395+ _script_selected (idx);
2396+ _menu_option (FILE_CLOSE);
2397+ }
2398+ } break ;
23882399
2389- _make_script_list_context_menu ();
2400+ case BUTTON_RIGHT: {
2401+ _make_script_list_context_menu ();
2402+ } break ;
2403+ }
23902404 }
23912405}
23922406
You can’t perform that action at this time.
0 commit comments