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

Cannot use keyboard shortcut for Comment/Uncomment on macOS with French keyboard - help me contribute a fix! #625

Closed
mglst opened this issue Dec 18, 2022 · 8 comments

Comments

@mglst
Copy link
Contributor

mglst commented Dec 18, 2022

Description

The ⌘ + / keyboard shortcut for Comment/Uncomment does not work for me. I'm on a mid 2015 MacBook pro with a French keyboard, running macOS 12.6.3 and Processing 4.0.1. For reference, other users have encountered similar difficulties in this issue. The problem is that on the French keyboard, shift is needed to type a slash. However,

Possible Causes / Solutions

I've found a workaround / solution! The character 'below' slash e.g. without using shift is colon. I've added menu.edit.comment_uncomment.keystroke=meta pressed COLON to my preferences.txt file, and I'm now a happy camper. I imagine other people on a MacBook with a French keyboard might benefit from this being default behaviour.

  • Should I contribute this preference to PDE_fr.properties?
  • My keyboard is French, but my macOS system language is English. Does PDE_fr.properties get used in my case?
@benfry
Copy link
Owner

benfry commented Jan 4, 2023

If the language chosen in the Preferences dialog is French, it will use PDE_fr.properties.

There's no GUI support for "PDE is in English, but the keyboard is French".

However, you can edit preferences.txt as you've done:
https://github.com/processing/processing4/wiki/Translations#in-the-preferencestxt-file

@benfry
Copy link
Owner

benfry commented Jan 16, 2023

We can certainly add this to PDE_fr.properties which will be used for anyone who's using French as the language in Preferences; is that what you're asking to contribute?

@mglst
Copy link
Contributor Author

mglst commented Jan 30, 2023

It's unfortunate for my use case that Processing assumes my keyboard layout matches my language preference. I appreciate this is likely a niche scenario. I suppose the logical next step would adding GUI support for choosing both independently. I also imagine it's more trouble than it's worth!

In the meantime I've made a PR #660 editing PDE_fr.properties

@benfry
Copy link
Owner

benfry commented Feb 10, 2023

Thanks for that… Do you have a sense of how this is handled with other editors? i.e. is this a standard key combination for comment/uncomment used by any others (like VS Code or IntelliJ or who knows what)?

@mrbbp
Copy link

mrbbp commented Mar 24, 2023

on macOS French
Command + = to comment/uncomment :)

@benfry
Copy link
Owner

benfry commented Jul 16, 2023

Ok, so we contradicting suggestions for Cmd-Equals and a PR that uses Cmd-Colon. :)

Can anyone on a French system let me know what's used by other editors (VS Code and IntelliJ in particular) when French is the language? I'd like us to be using something that others will be expecting (if there is such a thing) rather than making up our own.

@mglst
Copy link
Contributor Author

mglst commented Jul 17, 2023

Here are the results of some investigating on my French macOS system:

In VS Code (1.80.0)

Under Preferences: Open Keyboard Shortcuts:

  • editor.action.commentLine has binding :
  • editor.action.blockComment has binding A

For some reason, in the JSON file the keymap for editor.action.commentLine is incorrectly stored as shift+cmd+[Period] however the shortcut is correctly triggered with a colon - seemingly this is a quirk / bug.

In IntelliJ IDEA (2023.1.4):

  • Comment with Line Comment has binding :
  • Comment with Block Comment has binding :

On JetBeans official help page, there is a note about non-English keyboard layouts which includes a note about the German keyboard layout not having a key for forward slash and so not having a shortcut to comment the current line. The recommendation is to install a plugin called Keymap Nationalizer. Neither of the above shortcuts work, Installing this plugin resolves this.

In Xcode (14.3.1):

  • Editor > Structure > Comment Selection has binding :

This is the same keybinding as IntelliJ. Seemingly there is option for block comments, unlike VS Code and IntelliJ.

@benfry
Copy link
Owner

benfry commented Jul 17, 2023

This is so helpful, thank you! That's now merged for the next release.

@benfry benfry closed this as completed Jul 17, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants