You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Rename "Control" key to "Ctrl" and add "_pressed" suffix to all InputEventWithModifiers properties/methods
This commit is contained in:
@@ -115,7 +115,7 @@ void SpriteFramesEditor::_sheet_preview_input(const Ref<InputEvent> &p_event) {
|
||||
|
||||
int idx = h * y + x;
|
||||
|
||||
if (mb->get_shift() && last_frame_selected >= 0) {
|
||||
if (mb->is_shift_pressed() && last_frame_selected >= 0) {
|
||||
//select multiple
|
||||
int from = idx;
|
||||
int to = last_frame_selected;
|
||||
@@ -124,7 +124,7 @@ void SpriteFramesEditor::_sheet_preview_input(const Ref<InputEvent> &p_event) {
|
||||
}
|
||||
|
||||
for (int i = from; i <= to; i++) {
|
||||
if (mb->get_control()) {
|
||||
if (mb->is_ctrl_pressed()) {
|
||||
frames_selected.erase(i);
|
||||
} else {
|
||||
frames_selected.insert(i);
|
||||
@@ -150,11 +150,11 @@ void SpriteFramesEditor::_sheet_scroll_input(const Ref<InputEvent> &p_event) {
|
||||
// Zoom in/out using Ctrl + mouse wheel. This is done on the ScrollContainer
|
||||
// to allow performing this action anywhere, even if the cursor isn't
|
||||
// hovering the texture in the workspace.
|
||||
if (mb->get_button_index() == MOUSE_BUTTON_WHEEL_UP && mb->is_pressed() && mb->get_control()) {
|
||||
if (mb->get_button_index() == MOUSE_BUTTON_WHEEL_UP && mb->is_pressed() && mb->is_ctrl_pressed()) {
|
||||
_sheet_zoom_in();
|
||||
// Don't scroll up after zooming in.
|
||||
accept_event();
|
||||
} else if (mb->get_button_index() == MOUSE_BUTTON_WHEEL_DOWN && mb->is_pressed() && mb->get_control()) {
|
||||
} else if (mb->get_button_index() == MOUSE_BUTTON_WHEEL_DOWN && mb->is_pressed() && mb->is_ctrl_pressed()) {
|
||||
_sheet_zoom_out();
|
||||
// Don't scroll down after zooming out.
|
||||
accept_event();
|
||||
@@ -694,11 +694,11 @@ void SpriteFramesEditor::_tree_input(const Ref<InputEvent> &p_event) {
|
||||
const Ref<InputEventMouseButton> mb = p_event;
|
||||
|
||||
if (mb.is_valid()) {
|
||||
if (mb->get_button_index() == MOUSE_BUTTON_WHEEL_UP && mb->is_pressed() && mb->get_control()) {
|
||||
if (mb->get_button_index() == MOUSE_BUTTON_WHEEL_UP && mb->is_pressed() && mb->is_ctrl_pressed()) {
|
||||
_zoom_in();
|
||||
// Don't scroll up after zooming in.
|
||||
accept_event();
|
||||
} else if (mb->get_button_index() == MOUSE_BUTTON_WHEEL_DOWN && mb->is_pressed() && mb->get_control()) {
|
||||
} else if (mb->get_button_index() == MOUSE_BUTTON_WHEEL_DOWN && mb->is_pressed() && mb->is_ctrl_pressed()) {
|
||||
_zoom_out();
|
||||
// Don't scroll down after zooming out.
|
||||
accept_event();
|
||||
@@ -954,7 +954,7 @@ void SpriteFramesEditor::drop_data_fw(const Point2 &p_point, const Variant &p_da
|
||||
if (String(d["type"]) == "files") {
|
||||
Vector<String> files = d["files"];
|
||||
|
||||
if (Input::get_singleton()->is_key_pressed(KEY_CONTROL)) {
|
||||
if (Input::get_singleton()->is_key_pressed(KEY_CTRL)) {
|
||||
_prepare_sprite_sheet(files[0]);
|
||||
} else {
|
||||
_file_load_request(files, at_pos);
|
||||
|
||||
Reference in New Issue
Block a user