You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 17:36:07 +00:00
Rename "Control" key to "Ctrl" and add "_pressed" suffix to all InputEventWithModifiers properties/methods
This commit is contained in:
@@ -2914,15 +2914,15 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
|
||||
}
|
||||
|
||||
if (mb->is_pressed()) {
|
||||
if (mb->get_button_index() == MOUSE_BUTTON_WHEEL_UP && !mb->get_command()) {
|
||||
if (mb->get_shift()) {
|
||||
if (mb->get_button_index() == MOUSE_BUTTON_WHEEL_UP && !mb->is_command_pressed()) {
|
||||
if (mb->is_shift_pressed()) {
|
||||
h_scroll->set_value(h_scroll->get_value() - (100 * mb->get_factor()));
|
||||
} else if (v_scroll->is_visible()) {
|
||||
_scroll_up(3 * mb->get_factor());
|
||||
}
|
||||
}
|
||||
if (mb->get_button_index() == MOUSE_BUTTON_WHEEL_DOWN && !mb->get_command()) {
|
||||
if (mb->get_shift()) {
|
||||
if (mb->get_button_index() == MOUSE_BUTTON_WHEEL_DOWN && !mb->is_command_pressed()) {
|
||||
if (mb->is_shift_pressed()) {
|
||||
h_scroll->set_value(h_scroll->get_value() + (100 * mb->get_factor()));
|
||||
} else if (v_scroll->is_visible()) {
|
||||
_scroll_down(3 * mb->get_factor());
|
||||
@@ -2977,7 +2977,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
|
||||
cursor_set_line(row, false, false);
|
||||
cursor_set_column(col);
|
||||
|
||||
if (mb->get_shift() && (cursor.column != prev_col || cursor.line != prev_line)) {
|
||||
if (mb->is_shift_pressed() && (cursor.column != prev_col || cursor.line != prev_line)) {
|
||||
if (!selection.active) {
|
||||
selection.active = true;
|
||||
selection.selecting_mode = SelectionMode::SELECTION_MODE_POINTER;
|
||||
@@ -3073,7 +3073,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
|
||||
}
|
||||
} else {
|
||||
if (mb->get_button_index() == MOUSE_BUTTON_LEFT) {
|
||||
if (mb->get_command() && highlighted_word != String()) {
|
||||
if (mb->is_command_pressed() && highlighted_word != String()) {
|
||||
int row, col;
|
||||
_get_mouse_pos(Point2i(mpos.x, mpos.y), row, col);
|
||||
|
||||
@@ -3116,7 +3116,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
|
||||
mpos.x = get_size().x - mpos.x;
|
||||
}
|
||||
if (select_identifiers_enabled) {
|
||||
if (!dragging_minimap && !dragging_selection && mm->get_command() && mm->get_button_mask() == 0) {
|
||||
if (!dragging_minimap && !dragging_selection && mm->is_command_pressed() && mm->get_button_mask() == 0) {
|
||||
String new_word = get_word_at_pos(mpos);
|
||||
if (new_word != highlighted_word) {
|
||||
emit_signal("symbol_validate", new_word);
|
||||
@@ -3165,7 +3165,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
|
||||
#ifdef OSX_ENABLED
|
||||
if (k->get_keycode() == KEY_META) {
|
||||
#else
|
||||
if (k->get_keycode() == KEY_CONTROL) {
|
||||
if (k->get_keycode() == KEY_CTRL) {
|
||||
#endif
|
||||
if (select_identifiers_enabled) {
|
||||
if (k->is_pressed() && !dragging_minimap && !dragging_selection) {
|
||||
@@ -3183,7 +3183,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
|
||||
}
|
||||
|
||||
// If a modifier has been pressed, and nothing else, return.
|
||||
if (k->get_keycode() == KEY_CONTROL || k->get_keycode() == KEY_ALT || k->get_keycode() == KEY_SHIFT || k->get_keycode() == KEY_META) {
|
||||
if (k->get_keycode() == KEY_CTRL || k->get_keycode() == KEY_ALT || k->get_keycode() == KEY_SHIFT || k->get_keycode() == KEY_META) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3191,7 +3191,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
|
||||
|
||||
// Allow unicode handling if:
|
||||
// * No Modifiers are pressed (except shift)
|
||||
bool allow_unicode_handling = !(k->get_command() || k->get_control() || k->get_alt() || k->get_metakey());
|
||||
bool allow_unicode_handling = !(k->is_command_pressed() || k->is_ctrl_pressed() || k->is_alt_pressed() || k->is_meta_pressed());
|
||||
|
||||
// Save here for insert mode, just in case it is cleared in the following section.
|
||||
bool had_selection = selection.active;
|
||||
@@ -3436,9 +3436,9 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
|
||||
// CURSOR MOVEMENT
|
||||
|
||||
k = k->duplicate();
|
||||
bool shift_pressed = k->get_shift();
|
||||
bool shift_pressed = k->is_shift_pressed();
|
||||
// Remove shift or else actions will not match. Use above variable for selection.
|
||||
k->set_shift(false);
|
||||
k->set_shift_pressed(false);
|
||||
|
||||
// CURSOR MOVEMENT - LEFT, RIGHT.
|
||||
if (k->is_action("ui_text_caret_word_left", true)) {
|
||||
|
||||
Reference in New Issue
Block a user