-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
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
Rename "Control" key to "Ctrl" and add "_pressed" suffix to all InputEventWithModifiers properties/methods #48168
Conversation
77c672e
to
1ff236a
Compare
1ff236a
to
3678501
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 good to me. Just one small nitpick below.
3678501
to
ec0d6d2
Compare
It would have been better for review purposes to split those changes into two PRs, the rename of That being said, now that the work is done let's keep it this way. I don't have a strong opinion on rename Control to Ctrl, but I'd just raise a comment that the name of keys doesn't necessarily match what's printed on the key caps... My laptop has "pg up" / "pg dn", yet we have I do not think that we should rename Now, if most are in favor of the rename I don't mind either way. On the other proposed changes to I don't feel strongly either about this but someone needs to raise a comment to get at least some discussion going on the merits of the change ;) |
My reasoning for this change was mostly because I thought adding For example: if (event->is_meta() || event->is_command()) {
// ...
} makes less sense to me than: if (event->is_meta_pressed() || event->is_command_pressed()) {
// ...
} The first one sounds like it's asking if the event is meta or if the event is a command (whatever that'd mean), which might be a little confusing to someone new to the codebase/unfamiliar with the Also I think it's more consistent with |
e5a8cb2
to
9f60d26
Compare
…EventWithModifiers properties/methods
9f60d26
to
97fecd1
Compare
Thanks! |
See #16863 (comment)
becomes
Renames:
KEY_CONTROL
toKEY_CTRL
MOD_CONTROL
toMOD_CTRL
InputEventWithModifiers
:_pressed
to all modifierscontrol
toctrl
(_pressed
)meta
(_pressed
)'s setters and getters to match the property name ([...]_metakey_pressed()
->[...]_meta_pressed()
)get_
tois_
for modifiers' gettersOn MacBook keyboards, Ctrl is often control, but I believe Ctrl is more common (the documentation literally calls it the Ctrl modifier, and most comments in the code say Ctrl) and more importantly won't get confused with
Control
nodes.