-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace Ctrl in editor shortcuts with Cmd or Ctrl depending on platform #71905
Replace Ctrl in editor shortcuts with Cmd or Ctrl depending on platform #71905
Conversation
@@ -282,7 +282,7 @@ bool AbstractPolygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) | |||
if (mode == MODE_EDIT || (_is_line() && mode == MODE_CREATE)) { | |||
if (mb->get_button_index() == MouseButton::LEFT) { | |||
if (mb->is_pressed()) { | |||
if (mb->is_ctrl_pressed() || mb->is_shift_pressed() || mb->is_alt_pressed()) { | |||
if (mb->is_command_or_control_pressed() || mb->is_shift_pressed() || mb->is_alt_pressed()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, the check seems t be no modifiers
, so it's probably should be ctrl || meta || shift || alt
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are totally right went a bit too quick on this one because you can't access it without click left mouse button. Gonna modify it.
editor/editor_spin_slider.cpp
Outdated
@@ -215,7 +210,7 @@ void EditorSpinSlider::_value_input_gui_input(const Ref<InputEvent> &p_event) { | |||
} | |||
} | |||
|
|||
if (k->is_ctrl_pressed()) { | |||
if (k->is_command_or_control_pressed()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While checking all of the modifications. I realized that this case is totally a case of snaping. I had put it on CMD_OR_CTRL
as tooltip already said you should use command even though you had to press ctrl in fact. I'm wondering if i should remove it and move it back to CTRL
or if it is a sign cmd should be used for snapping.
139a02c
to
3b8a29e
Compare
81596e5
to
bf31c21
Compare
bf31c21
to
d05cbb7
Compare
0022592
to
2c84ebb
Compare
116eb5d
to
805a914
Compare
07e70d6
to
da3d1dc
Compare
Finally took the time to update this PR so it is up to date. This fix a loot of places where you had to press ctrl instead of command in MAcOS which was inintuitive and in more than half the case just impossible. Most of those bug are not reported or reported for 3.x as most of them were already present in 3.x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally on Linux (rebased on top of master
6758a7f), it works as expected. This needs to be rebased though.
The list of keys changed seems logical to me.
Also, please amend the commit message to follow existing style:
Replace Ctrl in editor shortcuts with Cmd or Ctrl depending on platform
23945c2
to
c1013cc
Compare
CC @bruvzg |
c1013cc
to
6afadba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me overall.
Thanks! |
following #64021
related issue #64456 (Fix the issue but the issue is for 3.5 so not really a fix to this issue)
After a thorough check of all instances where CTRL is used(
is_ctrl_pressed()
,Key::CTRL
andKeyModifierMask::CTRL
) i have sorted the uses in multiple categories here in this PR are three categories where i think modifications should be done :CMD_OR_CTRL
was reimplemented on the fly and remove him from places where he was checked in conjonction with bothCTRL
andMETA
CTRL
is either preventing MacOS user from using the functionality or makes it inconsistent with either what is said or what is already done else where.CTRL
is pressed. This functionality is used consistently with ctrl but on mac. it seemsCMD
would be more appropriate especially since you might start pressing the modifier button when starting to drag.There are a few other places where
CTRL
is used and i think it should stay like this but i'm not entirely sure see here for all places:CTRL
but this is the one i'm the least sure of.CTRL+ SCROLL
: when scrolling pressingCTRL
will enables you to zoom. This is better asCTRL
as this is fundamentally not a MacOS way to do it. Therefore even on mac if i think of doing it i would useCTRL
as if i was on a windows.CTRL
instead ofCMD
The problem here is that i currently have only my experience and what feels right to me. So i would really like the opinion of other MacOS users on the subject.
Left to do (maybe another PR):
CMD
if it is not already done (edit : did everything in the editor part might do the documentation part later)is_command_or_control_pressed()
tois_cmd_or_ctrl_pressed()
to be more in line with other similar functions (is_ctrl_pressed()
)