Skip to content

Add apple_platform feature to check if running on apple platform #108181

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

OzelotVanilla
Copy link
Contributor

What it can do ?

This helps to determine at least about whether the CTRL or the META should be used for shortcut.

Motivation

Reduce manually checking like this.

if (OS::get_singleton()->has_feature("macos") || OS::get_singleton()->has_feature("web_macos") || OS::get_singleton()->has_feature("web_ios")) {

Mentioned also in the comment of #108034 (comment), which is about the checking logic of whether current platform is apple or not.

TODO

If it is necessary to do so, I will add also the doc and core-bind.

… platform

This helps to determine at least about whether the `CTRL` or the `META` should be used for shortcut.
@OzelotVanilla OzelotVanilla requested a review from a team as a code owner July 2, 2025 02:10
@OzelotVanilla
Copy link
Contributor Author

Seems like has_feature is not const (should it be ?).

So this is_apple_platform is also leaved non-const currently.

@AdriaandeJongh
Copy link
Contributor

why not just add a feature tag to all platforms using the apple platform, using the feature system that was already built precisely for this?

@OzelotVanilla
Copy link
Contributor Author

why not just add a feature tag to all platforms using the apple platform, using the feature system that was already built precisely for this?

Thank you! Let me change it later.

@Ivorforce Ivorforce changed the title Add method is_apple_platform to check if running on apple platform Add apple_platform feature to check if running on apple platform Jul 2, 2025
@Ivorforce Ivorforce requested a review from bruvzg July 2, 2025 14:53
@adamscott
Copy link
Member

adamscott commented Jul 2, 2025

I'm against the premise of the PR. We should have instead an OS method that explicitly says if Ctrl or Meta should be used. I'm writing a proposal right now.

@OzelotVanilla
Copy link
Contributor Author

I'm against the premise of the PR. We should have instead an OS method that explicitly says if Ctrl or Meta should be used. I'm writing a proposal right now.

The motivation (I would not think it as a premise) here is truly get the corresponding CTRL key, but since I do not know what is the other usage of doing checking feature apple_platform could help, so I could not say if this feature is really helpful in other situation or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants