GDQuest / learn-gdscript

Learn Godot's GDScript programming language from zero, right in your browser, for free.
https://gdquest.github.io/learn-gdscript/
Other
2.07k stars 153 forks source link

Undo/Redo controls use Control instead of Command on MacOS #711

Open BruceMcRooster opened 1 year ago

BruceMcRooster commented 1 year ago

Describe the bug The command key (⌘) is typically used in MacOS applications to perform most actions, including those of undo (⌘+Z) and redo (⌘+Y, ⌘+Shift+Z). The app uses the control key (⌃) for these instead.

To Reproduce Steps to reproduce the bug:

  1. Use a Mac
  2. Open any code editor in the app
  3. Try to use Undo/Redo with the command (⌘) key

Expected behavior The app should use typical keyboard shortcuts on MacOS, being ⌘+Z for undo, and ⌘+Y and ⌘+Shift+Z for redo. It's fine if Control still can perform these functions, but the Command key should definitely work.

Information about your device (please complete the following information):

NathanLovato commented 1 year ago

How about Copy and paste, do these work with command? The browser hides the fact that you're on mac, and aside from Firefox, browsers seem like they don't all have native macos shortcuts. We've tried to offer experimental support for macos shortcut in the last update, but this introduces other issues so we may not be able to keep the feature, but we'll try.

In the meantime I invite you to download the desktop macOS release to get the correct shortcuts: https://gdquest.itch.io/learn-godot-gdscript

NathanLovato commented 1 year ago

Actually this should already be available since release 1.3.0. Could you please go to this link, try out the command-based shortcuts in your browser, and tell me if this is working? https://gdquest.github.io/learn-gdscript/staging/

BruceMcRooster commented 1 year ago

Still having the same problem using the link you gave. I might look into the code if I get a chance and see if I can make a PR.

armorup commented 1 year ago

I'm also having this issue. I tried the link suggested above, but same problem: https://gdquest.github.io/learn-gdscript/staging/

The Copy and Paste are also not working.

Specifically, I was experimenting with the Mac command shortcuts with lesson 4.1 - Drawing a rectangle practice.

NathanLovato commented 1 year ago

We added, then removed code for this. Now, we won't support these shortcuts for macOS in the browser. You should be able to use Cmd for shortcuts with Firefox.

The problem is that some browsers have macOS shortcuts built-in, others don't, and if we add macOS shortcuts while the browser's already trying to simulate them, every shortcut will run twice.

As a workaround, I invite you to either use the app's desktop mac release or a browser that supports these shortcuts. I believe that Firefox does.

If anyone wants to take the time to implement this feature properly, the contribution would be most welcome, but we will not work more on this.

armorup commented 1 year ago

Ok, thanks for the prompt reply. I will try your suggestions and work around it.