You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Implement new shortcuts system.
unhandled_key_input changed to unhandled_button_input. Controls can set a 'shortcut_context' which they can then use to determine if their shortcuts should be triggered or not, based on if the viewport's focused GUI control is a child of their 'shortcut context'.
This commit is contained in:
@@ -1845,6 +1845,7 @@ ScriptTextEditor::ScriptTextEditor() {
|
||||
edit_menu = memnew(MenuButton);
|
||||
edit_menu->set_text(TTR("Edit"));
|
||||
edit_menu->set_switch_on_hover(true);
|
||||
edit_menu->set_shortcut_context(this);
|
||||
|
||||
convert_case = memnew(PopupMenu);
|
||||
convert_case->set_name("convert_case");
|
||||
@@ -1864,10 +1865,12 @@ ScriptTextEditor::ScriptTextEditor() {
|
||||
search_menu = memnew(MenuButton);
|
||||
search_menu->set_text(TTR("Search"));
|
||||
search_menu->set_switch_on_hover(true);
|
||||
search_menu->set_shortcut_context(this);
|
||||
|
||||
goto_menu = memnew(MenuButton);
|
||||
goto_menu->set_text(TTR("Go To"));
|
||||
goto_menu->set_switch_on_hover(true);
|
||||
goto_menu->set_shortcut_context(this);
|
||||
|
||||
bookmarks_menu = memnew(PopupMenu);
|
||||
bookmarks_menu->set_name("Bookmarks");
|
||||
|
||||
Reference in New Issue
Block a user