Skip to content
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

On Windows, it is impossible to set shortcuts for Mac which use Control/Command #42351

Closed
EricEzaM opened this issue Sep 26, 2020 · 2 comments · Fixed by #43662
Closed

On Windows, it is impossible to set shortcuts for Mac which use Control/Command #42351

EricEzaM opened this issue Sep 26, 2020 · 2 comments · Fixed by #43662

Comments

@EricEzaM
Copy link
Contributor

EricEzaM commented Sep 26, 2020

Godot version:
All versions

OS/device including version:
Windows 10 and macOS 10.15.6

Issue description:
On Windows I set an input action to be Control + E. This serialises to "control":true,"command":true in project.godot

When performing the action on Mac, neither Control + E or Command + E trigger the action - only Command + Control + E does. This is not what is intended.

Steps to reproduce:
As above...

Minimal reproduction project:
See attached. Run the example scene on both Windows (or Linux) and on Mac. You will observe the described behaviour.
WindowsMacShortcuts.zip

@EricEzaM
Copy link
Contributor Author

EricEzaM commented Sep 26, 2020

There should be an additional option in the input map UI to select keys and modifiers from a list, instead of just Press A Key.... This would circumvent this issue to some extent.

Also, the same thing would apply in the opposite direction because of the below union. If you set a shortcut on Mac to be Command + E, this would serialise to command=true, meta=true, which would require command (control) and meta (windows key) to be pressed on windows/linux. I feel like maybe these unions should be removed...

// input_event.h
#ifdef APPLE_STYLE_KEYS
	union {
		bool command;
		bool meta = false; //< windows/mac key
	};

	bool control = false;
#else
	union {
		bool command; //< windows/mac key
		bool control = false;
	};
	bool meta = false; //< windows/mac key
#endif

@EricEzaM EricEzaM changed the title Impossible to set shortcuts on Windows for Mac which use Control/Command On Windows, it is impossible to set shortcuts for Mac which use Control/Command Sep 27, 2020
@EricEzaM
Copy link
Contributor Author

After some discussion with reduz on IRC, it was decided that the option should be given to the user whether they want to store Command or Control (on Windows) or Meta (on Mac). An image of the WIP UI is below. This is part of a larger refactor of the action map editor so it is more generic (can be used not just for ProjectSettings) and easy to follow.

image

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